Re: Problem establishing a https connection - Weblogic
This is a discussion on Re: Problem establishing a https connection - Weblogic ; Actualy, if u r trying to make https connection, u should do a SSL handshake with the certificate (should be trusted one). So, ensure that ur certificate installed in caserts.
U may try by including the lines
SSLContext sslContext = ...
-
Re: Problem establishing a https connection
Actualy, if u r trying to make https connection, u should do a SSL handshake with the certificate (should be trusted one). So, ensure that ur certificate installed in caserts.
U may try by including the lines
SSLContext sslContext = SSLContext.getInstance("SSLv3");
sslContext.init(null, trustMgtFactory.getTrustManagers(), null);
SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sslS ocketFactory);
-
Re: Problem establishing a https connection
Thx for the prompt reply....But this is not solving my problem.
I am trying to establish the connection from inside a weblogic container. So i am forced to use weblogic APIs.
Also i use NulledTrustManager and NulledHostNameVerifier so i think i neednot worry about the certificates...
Weblogic APIs donot contain init method for sslcontext....So if u can see the code, i have commented these lines and set these properties using the Weblogic supported APIs.
Also the method which u specified (Using Java APIs) was working for me....problem arose when i tried to use weblogic specific APIs.
Can u go through the code once and tell me if i am missing something over there? Coz header is not getting populated, the request is not hitting the secure server
One more thing, if i use the HostNameVerifier(dummy one to verify all the hosts), it tells me tht the key chain obtained from the host is incomplete.... and throws javax.net.ssl.SSLKeyException...
If i remover hostnameverifier, the exception is not thrown, but the request is not hitting the server...
Plz help me ... i am helplessly stuck in this situation...
Thx in advance for all the helping minds.....