Read from a HTTPS url

I'm new to HTTPS and SSL implementation, so my question may seem very basic to you all.

I'm trying to read from an HTTPS url. I can successfully read a standard HTTP url. I've read a lot of the posts, but I can't seem to get a handle on how to do this. We are not concerned about verifying certificates either on the server or client, as we are just using HTTPS to encrypt the connection and nothing else.

Could someone please send me the code, etc that I would need in order to do this? I'd greatly appreciate any help you can give me, and I'll be happy to reward you with Duke dollars! (I'm also an expert Swing developer so I can help you that way as well :)

Thanks!

[701 byte] By [landisaa] at [2007-11-26 18:44:00]
# 1

Try this:

System.setProperty("java.protocol.handler.pkgs",

"com.sun.net.ssl.internal.www.protocol");

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

URL url = new URL("https://myserver.com");

URLConnection con = URL.openConnection();

The server you're contacting must still have a valid SSL certificate installed.

bckrispia at 2007-7-9 6:17:55 > top of Java-index,Core,Core APIs...
# 2

> Try this:

>

> >System.setProperty("java.protocol.handler.pkgs",

>"com.sun.net.ssl.internal.www.protocol");

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

>URL url = new URL("https://myserver.com");

Above is all unnecessary since Jave 1.4.

> URLConnection con = URL.openConnection();

>

>

> The server you're contacting must still have a valid

> SSL certificate installed.

which is trusted by the client's truststore.

ejpa at 2007-7-9 6:17:55 > top of Java-index,Core,Core APIs...
# 3
Thank you that worked perfectly!
landisaa at 2007-7-9 6:17:55 > top of Java-index,Core,Core APIs...