Facing issues connecting to a third party secured url
Hi,
I am trying to connect to a secured url. I have added all the required certificates to the java trust store and keystore. I am using javax.net.ssl.HttpsURLConnection to connect to the url. I am successfully able to do so on my local machine. However on other serverw like staging, prod etc, I am facing issues because weblogic is managing those servers. So, I get a class cast exception -
weblogic.net.http.SOAPHttpsURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection.
One solution would be to make changes to weblogic env settings and add JAVA_OPTIONS="-DUseSunHttpHandler=true” to the startManagedWebLogic.sh file.I do not want to make changes to any env settings.
Second option is to change my code and use -
java.net.URL url;
javax.net.ssl.HttpsURLConnection httpsConn = null;
try {
url = new URL(null, ENDPOINT,new sun.net.www.protocol.https.Handler());'
}
When I try to so, my bundle is not able to resolve this pcakage and giving error - sun.net.www.protocol.https -- Cannot be resolved
in felix console - system/console/bundles.
Any solution would be appreciated to resolve this issues in bundle.
Regards,
Shallu Rohilla