#451 HTTPS SSL Proxy Support JDK5+

open
nobody
None
5
2013-02-21
2013-02-21
Melloware Inc
No

I needed a client that had SSL proxying ability. In WebConversation.java it is only accounting for http proxies. It needs to support HTTPS as well as a different HTTPS port. Below are the mods I had to make to WebConversation to make it work with HTTPS SSL Proxies.

private int _proxyPortSsl;

if (_proxyHost != null) {
// Fixed SSL proxying in JDK5 and 6
System.setProperty("http.proxyHost", _proxyHost);
System.setProperty("http.proxyPort", Integer.toString(_proxyPort));
System.setProperty("https.proxyHost", _proxyHost);
System.setProperty("https.proxyPort", Integer.toString(_proxyPortSsl));
}

public void setProxyServer(String proxyHost, int proxyPort, int proxyPortSsl) {
_proxyHost = proxyHost;
_proxyPort = proxyPort;

// if SSL not set default it to the proxy port
if (proxyPortSsl <= 0) {
_proxyPortSsl = _proxyPort;
} else {
_proxyPortSsl = proxyPortSsl;
}
}

Discussion