Why the HttpsURLConnection I got is different in two scenarios?->ClassCastE
I got the a problem!
I used a common block code to connect to a https server,but I got ClassCastException
(HttpsURLConnection) URL.openConnection() works well in a standalone application.
but the same code thorws ClassCastException while it run in a servlet thread.
I use toString() to print the Object content which I got from URL.openConnection() and I found a strange but maybe important thing:
the Object I got is different in two scenarios!
Object returned in standalone application is sun.net.www.protocol.https.DelegateHttpsURLConnection
and in servlet thread is
com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection
Who can explain this and help me?
I think I can pass this problem while I find the way to get sun.net.www.protocol.https.DelegateHttpsURLConnection in servlet thread

