[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-ssl] HTTPS connection question



I am using iaik iSaSiLkApplet-3.02 to write a simple HTTPS connection. The 
code is very similar to the HttpsDemo. I setup a HTTPS connection, first 
write to it and then read from it.
The code runs successfully when it runs as a application. But when I 
embedded in an applet, it fails when the program try to read from the 
connection.

Here are the debug information:
1. run as Applet
ssl_debug(1): Starting handshake...
ssl_debug(1): Sending v3 client_hello message, requesting version 3.1...
ssl_debug(1): SSLException while handshaking: Invalid SSL message, peer 
seems to be talking plain!
ssl_debug(1): Sending alert: Alert Fatal: handshake failure
ssl_debug(1): Shutting down SSL layer...
ssl_debug(1): Shutting down SSL layer...
ssl_debug(1): Shutting down SSL layer...
ssl_debug(1): Closing transport...

2. run as Application
ssl_debug(1): Starting handshake...
ssl_debug(1): Sending v3 client_hello message, requesting version 3.1...
ssl_debug(1): Received v3 server_hello handshake message.
ssl_debug(1): Server selected SSL version 3.1.
ssl_debug(1): Server created new session 4E:56:0D:9C:AB:6C:A6:25...
ssl_debug(1): CipherSuite selected by server: SSL_RSA_WITH_3DES_EDE_CBC_SHA
ssl_debug(1): CompressionMethod selected by server: NULL
ssl_debug(1): Received certificate handshake message with server 
certificate.
ssl_debug(1): Server sent a 1024 bit RSA certificate, chain has 2 elements.
ssl_debug(1): ChainVerifier: No trusted certificate found, OK anyway.
ssl_debug(1): Received server_hello_done handshake message.
ssl_debug(1): Sending client_key_exchange handshake message (1024 bit)...
ssl_debug(1): Sending change_cipher_spec message...
ssl_debug(1): Sending finished message...
ssl_debug(1): Received change_cipher_spec message.
ssl_debug(1): Received finished message.
ssl_debug(1): Session added to session cache.
ssl_debug(1): Handshake completed.

here is the code section.
            SSLContext context = new SSLClientContext();
            context.setDebugStream(System.out);
            // setup SSL-configuration
            con.setSSLContext(context);

            con.setRequestMethod("POST");
            con.setDoInput(true);
            con.setDoOutput(true);

            con.setRequestProperty("Content-type", "text/plain");

	// give applet the privilege to connect to other machine
            PrivilegedNetAccess privcon = new PrivilegedNetAccess(con);
            DataOutputStream out = new 
DataOutputStream(privcon.getHttpsOutputStream());
    	// write something
            out.close();

            // It fails here
            InputStream in = new 
BufferedInputStream(privcon.getHttpsInputStream());


Any ideas what is wrong with this?

Cindy

--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-ssl/sslthreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-ssl