• Post Reply Bookmark Topic Watch Topic
  • New Topic

SSL implementation not available

 
Jose Alberto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ! I try to connect to a https server using a proxy ...
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
URL url = new URL("https://www..../");
URLConnection urlc = url.openConnection();
if(urlc instanceof com.sun.net.ssl.HttpsURLConnection){
com.sun.net.ssl.HttpsURLConnection httpsUrl = (com.sun.net.ssl.HttpsURLConnection) urlc;
SSLTunnelSocketFactory un = new SSLTunnelSocketFactory(proxyHost,proxyPort);
httpsUrl.setRequestMethod("POST");
java.io.InputStream out = httpsUrl.getInputStream();
but when I try to get the InputStream I find the SSL not available �Any idea? . Thanks.
 
Zabe Agha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jose. Some questions.
1. Which version of the JDK are you using? If you'r enot using 1.4+, you'll need to get the JSSE package. If you're using 1.4, JSSE is part of it.
2. The error you're getting is at compilation or runtime? What is the error, exactly?
3. Are you sure you imported javax.net.ssl.*?
 
Jose Alberto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Which version of the JDK are you using? If you'r enot using 1.4+, you'll need to get the JSSE package. If you're using 1.4, JSSE is part of it.
Really I am using jsse-1_0_3_01-gl ... I belived it was enough ... I going to try with j2sdk1.4.1 now. Thanks
2. The error you're getting is at compilation or runtime? What is the error, exactly?
Runtime
3. Are you sure you imported javax.net.ssl.*?
Yes, sure.
 
Zabe Agha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using JSSE, you shold be fine. You need to make sure you're importing JAR files into your classpath.
You can check out:
http://java.sun.com/products/jsse/
At the bottom, in the Releases section, it mentions the status of JSSE.
Also, I'm doing something very similiar but having a problem. I'm discussing it at:
http://www.coderanch.com/t/205729/sockets/java/HttpsURLConnection-ClassCastException
I think you might run into the same situation: Basically, you're trying to check if your URL will be an instanceof HttpsURLConnection. If what I understand is correct, it never should be. Can you verify for this me on the other list? Thx in advance.
[ February 28, 2003: Message edited by: Aurangzeb Agha ]
 
Jose Alberto
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, in fact we had take the jsse1_0_3_01 from this site... then we hope to be using the right version... my problem is that I try to Implement HTTPS tunneling with JSSE by a proxy and following this example "http://www.javaworld.com/javaworld/javatips/jw-javatip111-p2.html" and I don't know if it is working right �?
Do you kown any way to implement that ??
Thanks a lot.
 
Zabe Agha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jose --
I just checked out the javaworld post you sent in your previous post and, since I'm having the same problem, tried the same thing. I noticed on compilation that I got a deprecation warning. Then I realized that HttpsURLConnection is no longer located at:
com.sun.net.ssl.HttpsURLConnection
In jdk1.4.1, its in javax.net.ssl.
(Thus the deprecation error).
We're both trying to solve the same problem: How to establish a https connection using a URL, and get a HttpsURLConnection.
Check your private messages in your profile.
[ February 28, 2003: Message edited by: Aurangzeb Agha ]
 
Zabe Agha
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jose -- After some searching on the Net, I ran into this:
A look at the latest networking features in J2SE 1.4
http://www-106.ibm.com/developerworks/java/library/j-mer02243.html
Look at the section that's called "Connecting with secure sockets" and see if that helps at all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!