I want to connect to an https://
URL in Java that requires proxy.
I have 2 proxies in the system:
HTTP -> proxy.teatre.guerrilla:8080
HTTPS -> proxy.teatre.guerrilla:8443
I've tried with
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy.teatre.guerrilla", 8080));
URL url = new URL ( urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection(proxy);
But I got a Exception in thread "main" java.net.ConnectException: Connection timed out: connect
and I haven't seen the type Proxy.Type.HTTPS
I also tried
System.setProperty("http.proxyHost", "proxy.teatre.guerrilla");
System.setProperty("http.proxyPort", "8080");
System.setProperty("https.proxyHost", "proxy.teatre.guerrilla");
System.setProperty("https.proxyPort", "8443");
with the same result.
I also tried to add this as Program arguments and VM arguments....
-Dhttp.proxyHost=proxy.teatre.guerrilla -Dhttp.proxyPort=8800 -Dhttps.proxyHost=proxy.teatre.guerrilla -Dhttps.proxyPort=8443