Milind Chaudhari

Greenhorn
+ Follow
since Jul 28, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Milind Chaudhari

Hi Gurav

I am facing the almost same issue, i followed the stpes as per the conversation of your and deepak, but still not working..... please reply me, i want to talk with u.
12 years ago
Hi,

I am trying to connect to the secured access url througg my POJO using Weblogic server. But I am getting error related with the problem in reading the license file as following:

"IP address of secured access url" was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.>



"IP address of secured access url" = actually the url which I trying to access.



I am using the below code:

URL url;

HttpsURLConnection connection;



this.keyStoreFile = fileName;

this.keystorePassword = keystorePassword;



try {



// ########### set trust manager

SSLContext sc = SSLContext.getInstance("SSLv3");

TrustManager[] tma = {new CertDownload()};

sc.init(null, tma, null);

SSLSocketFactory ssf = sc.getSocketFactory();

HttpsURLConnection.setDefaultSSLSocketFactory(ssf);

// ###########



// hostname verifier

HostnameVerifier hv = new HostnameVerifier() {

public boolean verify(String urlHostName, SSLSession session) {

System.out.println("Warning: URL Host: " + urlHostName

+ " vs. " + session.getPeerHost());

return true;

}

};

HttpsURLConnection.setDefaultHostnameVerifier(hv);



} catch (Exception e) {

System.out

.println("Error occurred when configuring the HttpsURLConnection : "

+ e.getMessage());

throw e;

}



try {

System.out.println("EndPoint is: " + endPoint);

url = new URL(endPoint);

connection = (HttpsURLConnection) url.openConnection();

connection.connect();

Certificate[] certs = connection.getServerCertificates();

System.out.println("Number of certificates: " + certs.length);

for (int i = 0; i < certs.length; i++) {

System.out.println("Server certificate type"

+ certs[i].getType());



addToKeyStore(certs[i], alias);

}

System.out.println("Successfully downloaded certificates.");

} catch (Exception e) {

System.out

.println("Error occurred while downloading certificate to KeyStore: "

+ e.getMessage());

throw e;

}



Properties properties = new Properties();

properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");

properties.put(Context.PROVIDER_URL, "t3s://Ip address:port no");

InitialContext context = new InitialContext(properties);




Please advise me for the above issue... early respose would be grateful to me...



12 years ago