javax.net.ssl.SSLException: SSL V2.0 servers are not supported.
Victor Grazi <[email protected]> Thu, 11 Apr 2002 13:48:31 -0400
| Newsgroups | gmane.comp.windows.devel.java.security |
|---|---|
| Message-ID | <[email protected]> |
I am trying to build a java application to parse data residing on an https
web site. The app is able to create the connection, but when it tries to
get the input stream to the site, it throws the following IOException:
javax.net.ssl.SSLException: SSL V2.0 servers are not supported.
I WAS using jdk1.3, but I figured this might be a job for 1.4. I loaded
that up but I am still getting the same result.
Any ideas?
Much thanks/Victor Grazi
PS - Here is an excerpt of the problem code
public static void main(String[] args)
{
log("Java version:" + System.getProperty("java.version"));// prints:
Java version:1.4.0
new HttpsURLTest().test();
}
public void test()
{
// NEXT LINE IS FOR PRE JDK 1.4 ONLY
//// System.setProperty( "javax.net.debug", "all");
// I TRIED WITH AND WITHOUT THE NEXT LINE, BUT SAME RESULTS...
// Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
// ENABLE DEBUGGING FOR THE FUN OF IT...
System.setProperty( "javax.net.debug", "all");
try
{
URL url = new URL(HTTPS_URL);
HttpsURLConnection conn = (HttpsURLConnection)url.openConnection
();
// NEXT LINE IS THE OFFENDER...
InputStream in = conn.getInputStream();
// RATS! NEVER GETS HERE!
// Convert the InputStream contents to a String...
String contents = fetchStream(in);
// print the string contents
log(contents);
}
catch(MalformedURLException e)
{
log(HTTPS_URL + " MalformedURLException:" + e);
}
catch(IOException e)
{
log(HTTPS_URL + " IOException:" + e);
}
}
The information in this e-mail, and any attachment therein, is confidential
and for use by the addressee only. If you are not the intended recipient,
please return the e-mail to the sender and delete it from your computer.
Although The Bank of New York attempts to sweep e-mail and attachments for
viruses, it does not guarantee that either are virus-free and accepts no
liability for any damage sustained as a result of viruses.
You can read messages from the JAVA-SECURITY archive, unsubscribe from JAVA-SECURITY,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.