Author Message
DouglasWambo2
Joined: Dec 2, 2013
Messages: 74
Offline
Hello,
I have a custom java app that calls an external web service. The app works fine in simulation on my localhost. However when I deploy it to my Tomcat server (same version. 6.0.35) it fails on the WS call and drops out of my try/catch with no stack trace. Axis appears to be happy. I have removed and added the AXIS connector just to ensure that there wasn't an issue there. At this point, I really don't have a clue where to go to diagnose this.
Any ideas?

Help??? Doug
DouglasWambo2
Joined: Dec 2, 2013
Messages: 74
Offline
Good morning. I've narrowed the problem down, I think, to security certificates. I've added the External WS certificate and created a self-signed cert for my cacerts file and the app is still failing. I'm finding the following error in my catalina.out file. import java.security.cert.X509Certificate;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}

public void checkClientTrusted(X509Certificate[] certs, String authType) {
// Trust always
}

public void checkServerTrusted(X509Certificate[] certs, String authType) {
// Trust always
}
}
};

// Install the all-trusting trust manager
SSLContext sc = SSLContext.getInstance("SSL");
// Create empty HostnameVerifier
HostnameVerifier hv = new HostnameVerifier() {
public boolean verify(String arg0, SSLSession arg1) {
return true;
}
};

sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier(hv);

Any ideas?

D
DouglasWambo2
Joined: Dec 2, 2013
Messages: 74
Offline
Sorry guys, pasted the wrong thing in my previous post. Here's the error.
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ShwetaBehere
Joined: Dec 23, 2013
Messages: 136
Offline
Try looking at these posts:
https://devconnect.avaya.com/public/forum/d_forum_3.jsp?t=12668&f=6
https://devconnect.avaya.com/public/forum/d_forum_3.jsp?t=13298&f=6
DouglasWambo2
Joined: Dec 2, 2013
Messages: 74
Offline
I read those...and I did export the runtime files again and restart tomcat. I'm still getting the following:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ShwetaBehere
Joined: Dec 23, 2013
Messages: 136
Offline
Are you managing your certificates via the runtimeconfig administrative tool ?
Go to:   
Mobile view