This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes HTTPS protocol Unknown error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "HTTPS protocol Unknown error" Watch "HTTPS protocol Unknown error" New topic
Author

HTTPS protocol Unknown error

Chitra Sundaram
Greenhorn

Joined: Oct 24, 2000
Posts: 18
Hi,
when I try to create a URLConnection object with a https:// protocol, it gives me an "unknown protocol: https" error. How can I connect to such URLs?
Thanks
Chitra
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Hello,
First you need to get JSSE1.0.2 from the Sun site, install it and add the jar to your classpath.
Next add the code

before you create the URLConnection and it should work fine.
Hope this helps


[This message has been edited by Carl Trusiak (edited December 01, 2000).]


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Chitra Sundaram
Greenhorn

Joined: Oct 24, 2000
Posts: 18
Carl,
Thanks a bunch. I will try it.
Chitra
Scott Appleton
Ranch Hand

Joined: May 07, 2001
Posts: 195
I have installed JSSE (following the instructions as carefully as I could, since network security is somewhat Greek to me) and included Carl's code in my class. The second line (Security.addProvider()) generates the following error:
NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
The jar files are installed in <home>/lib/security, which is in my Classpath. The java.security.security file has been updated as the instructions direct. I don't know what else to do to make my program "see" the JSSE jar files. Any suggestions?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTPS protocol Unknown error
 
Similar Threads
malformedUrl exception
Using JMeter to test HTTPS connections
Using JMeter to test HTTPS connections
java.net.URL
unknown protocol - https