Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Intial Context with t3s protocal  RSS feed

Milind Chaudhari
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 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();


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

// 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;




} catch (Exception e) {


.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();


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) {


.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...

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!