Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTTPS error, pls help

0 views
Skip to first unread message

Bill

unread,
Mar 14, 2004, 3:21:56 PM3/14/04
to
Hi all,
I am trying to test https with JDK 1.3. I am using JSSE 1.0.3_02 with the
following sample code from SUN.

Also, if I need to use a client certificate, does anyone have any sample
code?
===================================
import java.security.*;
import java.io.*;
import java.net.*;

public class GetHttps {

public static void main(String[] args) {
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty( "https.proxyHost", "proxy" );
System.setProperty( "https.proxyPort", "8080" );

System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
try {
URL verisign = new URL("https://www.verisign.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(
verisign.openStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);

in.close();
}
catch (Exception e) {
e.printStackTrace();
}

}
}
============================================
I am receiving the following exception and don't know what to do to resolve
it.

Pls help.

javax.net.ssl.SSLException: untrusted server cert chain
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(DashoA6275)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
at java.io.OutputStream.write(OutputStream.java:56)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsClient.doConnect(DashoA6275
)
at
com.sun.net.ssl.internal.www.protocol.https.NetworkClient.openServer(DashoA6
275)
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.l(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpClient.<init>(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsClient.<init>(DashoA6275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA6275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect(Dasho
A6275)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStrea
m(DashoA6275)
at java.net.URL.openStream(URL.java:793)
at com.sap.xi.test.GetHttps.main(GetHttps.java:19)


Thanks in advance,
Bill


Real Gagnon

unread,
Mar 14, 2004, 9:53:08 PM3/14/04
to
"Bill" <bi...@tadi.com> wrote in news:c32et5$3tf$1...@news1.wdf.sap-ag.de:

> Hi all,
> I am trying to test https with JDK 1.3. I am using JSSE 1.0.3_02 with
> the following sample code from SUN.

Your code is working fine here.
WinXp jdk 1.5.0-beta

Bye.
--
Real Gagnon from Quebec, Canada
* Looking for Java or PB snippets ? Visit Real's How-to
* http://www.rgagnon.com/howto.html

Bill

unread,
Mar 15, 2004, 10:52:08 AM3/15/04
to
Hi all,
I looked in the documentation. It indicate the possible cause as:
Cause 1: This is generally caused by the remote side sending a certificate
that is unknown to the local side.

I am not aware that I need anything on my machine.

Pls advise.

Thanks...Bill

"Bill" <bi...@tadi.com> wrote in message
news:c32et5$3tf$1...@news1.wdf.sap-ag.de...

Bill

unread,
Mar 15, 2004, 12:57:03 PM3/15/04
to
Do I need to import anything into my keystore?


"Bill" <bi...@tadi.com> wrote in message
news:c32et5$3tf$1...@news1.wdf.sap-ag.de...

Real Gagnon

unread,
Mar 15, 2004, 5:45:04 PM3/15/04
to
> I am not aware that I need anything on my machine.

Check this
http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsalert%2F57436

Like I said, your code is working on the 1.5 beta.

0 new messages