我正在使用在后台运行的 Burp 代理服务器。我已将 cacert.der 插入到我的 Eclipse 指向的 java 信任库中。
现在我有以下代码:.................................................. ...................................
SslContextFactory sslContextFactory = new SslContextFactory();
HttpClient httpClient = new HttpClient(sslContextFactory);
httpClient.start();
Address address = new Address("127.0.0.1",8082);
Socks4Proxy socks4Proxy = new Socks4Proxy(address, true);
proxyConfiguration.getProxies().add(socks4Proxy);
Request request = httpClient.newRequest(
new URI("https://google.com"));
request.method(HttpMethod.GET);
ContentResponse contentResponse = request.send();
System.out.println(contentResponse.getContentAsString());
..................................................... …………………………………………………………………………………………………………
上面的代码给了我以下错误:
线程“主”java.util.concurrent.ExecutionException 中的异常:java.io.IOException:SOCKS4 隧道在 org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) 处的代码 84 失败。 eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) 在 org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:653) 在 Get.main(Get.java:43) .. ..................................................... …………………………………………………………………………………………………………………………
谁能建议我如何解决这个问题?