jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes problem accessing https through ssl connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem accessing https through ssl connection" Watch "problem accessing https through ssl connection" New topic

problem accessing https through ssl connection

Geetha Gubendran
Ranch Hand

Joined: Sep 04, 2006
Posts: 75
Hi I tried the program. The HTTP is working fine but not https. I enquired our INFRA team. When I set the same proxy in my firewall client, I am able to hit both https and http but when I set the proxy in the code, I am able to hit only http and not https. Then the INFRA guy told me that the proxy that we set using http.proxyHost does not allow the traffic to go beyond the intranet. does this property (http.proxyHost) have any limitations? Can someone suggest how to get over this issue?

import java.net.URL;
import java.net.URLConnection;
import java.security.Security;
import org.apache.commons.codec.binary.Base64;
public class TestSSL {
public static void main(String[] args) {
System.getProperties().put( "proxySet","true" );
System.getProperties().put("http.proxyHost", "XXX");
System.getProperties().put("http.proxyPort", "XXX");

Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
try {

//System.getProperties().put("java.protocol.handler.pkgs", "HTTPClient");
//URL url = new URL("https://www.verisign.com/");

//URL url = new URL("https://apps.telstra.xora.com/xoraapps/services/XoraTimeTrackUtilityServices40?wsdl");
URL url = new URL("http://www.google.com");
//URL url = new URL("https://www.verisign.com");
URLConnection con = url.openConnection();

con.setDoInput( true );
con.setDoOutput( true );
java.io.InputStream urlfs = con.getInputStream();
System.out.println("Successful Connection Establishment =>"+url.getHost());

} catch (Exception e) {
System.out.println("Print Exception Details =>"+e.toString());

I agree. Here's the link: http://aspose.com/file-tools
subject: problem accessing https through ssl connection
It's not a secret anymore!