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!

javax.net.ssl.HttpsURLConnection Problem

843811Mar 1 2005 — edited Apr 10 2006
Hi,

I want make an HTTPS connection from JBoss:
        // build url and connection
        URL url = null;
        try {
            url = new URL(mmsURL);
        }
        catch (MalformedURLException murle) {
            logger.fatal("sendMMS() failed build url to mmsURL=" + mmsURL, murle);
            throw new OMAException("MMS::sendMMS() failed build url to mmsURL=" + mmsURL, murle, ErrorIDs.FATAL_ERROR);
        }

        // open connection
        javax.net.ssl.HttpsURLConnection conn = null;
        try {
            conn = (javax.net.ssl.HttpsURLConnection) url.openConnection();
            conn.setSSLSocketFactory(ctx.getSocketFactory());
        }
        catch (IOException ioe) {
            logger.fatal("sendMMS() open connection failed to mmsURL=" + mmsURL, ioe);
            throw new OMAException("MMS::sendMMS() open connection failed to mmsURL=" + mmsURL, ioe, ErrorIDs.FATAL_ERROR);
        }
But I get an ClassCastException while url.openConnection() an
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
What cann I do?


Regards,
Rafal
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2006
Added on Mar 1 2005
9 comments
364 views