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!

What is HttpsURLConnectionOldImpl ?

843811Aug 5 2002 — edited Aug 6 2002
I'm implementing my own trust manager in order to use anonymous connection. I'm declaring the Sun internal SSL provider. When I try to open a URLConnection cast into a HttpsURLConnection object with the following code, I get a ClassCastException:

MySslSocketFactory xSSF = (MySslSocketFactory) MySslSocketFactory.getDefault ();
HttpsURLConnection.setDefaultSSLSocketFactory ( ( SSLSocketFactory ) xSSF );
xURL = new URL ( "https://www.changeme.com:443/" );
HttpsURLConnection xUrlConn = ( HttpsURLConnection ) xURL.openConnection ();

java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
at com.mycompany.utils.MyAccessor.<init>(MyAccessor.java:41)
at com.mycompany.utils.MyAccessor.main(MyAccessor.java:74)


I've been studying the examples given here, what could be wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2002
Added on Aug 5 2002
1 comment
1,472 views