Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HttpsURLConnection.getCipherSuite() IllegalStateException

843811Aug 26 2003 — edited Aug 27 2003
I'm getting different HttpsURLConnection behavior upgrading from 1.3.1_01 to 1.4.2. After opening a connection, setting its SSL socket factory, and connecting, the SSL cipher suite and server cert chain are not available.
connection = (HttpsURLConnection)url.openConnection();
connection.setSSLSocketFactory(sslSocketFactory);
connection.connect();
httpResponseCode = connection.getResponseCode(); // OK!
cipherSuite = connection.getCipherSuite(); // IllegalStateException: connection not yet open
This worked in 1.3.1_01. Notice that the response code comes back, and the web server logs a successful connection, so the SSL handshake has completed!

Why is the cipher suite not available (nor the server cert chain)?

Any help greatly appreciated - nbaughman
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2003
Added on Aug 26 2003
1 comment
447 views