I'm having a similar issue as Is it possible to use HTTPS proxy in HTMLunit? , but I'm using httpunit version 2.10. The previous post was around the time of the 2.10 release (changelog, so I don't know if anything has changed since then.
Specifically, this code:
WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6);
ProxyConfig proxyConfig = new ProxyConfig("localhost",8080);
proxyConfig.setSocksProxy(true);
webClient.setProxyConfig(proxy);
webClient.addRequestHeader("referer", "http://www.google.com");
webClient.setThrowExceptionOnScriptError(false);
webClient.setCssEnabled(false);
webClient.setJavaScriptEnabled(false);
HtmlPage page = webClient.getPage("https://somewebsite");
This should not work if I have no proxy running on 8080, but it does connect, just not through the proxy. In contrast, this crashes, like it should, when the proxy is not running:
HtmlPage page = webClient.getPage("http://somewebsite"); //not https
Is this still a deficiency in htmlunit? Is there a good workaround or hack to get socks proxy working with https?