Robbie, No, I didn't get exception like below. Your case seems like "java.io.IOException" - some IO related issue. Not security related.
Mohan -----Original Message----- From: [email protected] [mailto:[email protected]] Sent: 30 January 2009 21:53 To: Narayanaswamy, Mohan Subject: RE: Not able to ignore - sun.security.validator.ValidatorException: No trusted certificate found - Hi, I have also tried the code below in order to ignore the truststore - however I am getting the exception below. Did you see anything like this before you got your code to work? Thanks for your time. Rob 30-Jan-2009 13:34:38 org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI nterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC hain.java:220) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) : : Caused by: java.io.IOException: Not Found at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp onseInternal(HTTPConduit.java:1988) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp onse(HTTPConduit.java:1942) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTP Conduit.java:1867) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:595) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI nterceptor.handleMessage(MessageSenderInterceptor.java:62) Narayanaswamy, Mohan-2 wrote: > > Thanks. > > The following code worked. > > > > HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); > TLSClientParameters tlsParams = new > TLSClientParameters(); > TrustManager[] trustAllCerts = new TrustManager[] { new > FakeTrustManager() }; > tlsParams.setTrustManagers(trustAllCerts); > tlsParams.setDisableCNCheck(true); > httpConduit.setTlsClientParameters(tlsParams); > > public class FakeTrustManager implements > javax.net.ssl.X509TrustManager { > > public java.security.cert.X509Certificate[] getAcceptedIssuers() { > return null; > } > > public void > checkClientTrusted(java.security.cert.X509Certificate[] certs, String > authType) { > } > > public void > checkServerTrusted(java.security.cert.X509Certificate[] certs, String > authType) { > } > > } > > -----Original Message----- > From: Narayanaswamy, Mohan > [mailto:[email protected]] > Sent: 20 January 2009 21:50 > To: [email protected] > Subject: Not able to ignore - sun.security.validator.ValidatorException: > No trusted certificate found - > > I call the below "initSSL()" method, before invoking webservice, > still I get the below exception. > > does CXF uses other than built-in HttpsURLConnection? > > How to ignore the trustStore? > > Note : I am just writing a POC using CXF aginst old webservice - where > service is not under my control. > > Mohan > > > private static void initSSL() { > System.setProperty("javax.net.debug ", "true"); > try { > TrustManager[] trustAllCerts = new > TrustManager[] { new FakeTrustManager() }; > SSLContext sc = SSLContext.getInstance("SSL"); > sc.init(null, trustAllCerts, new > java.security.SecureRandom()); > > HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); > > } catch (KeyManagementException e) { > e.printStackTrace(); > } catch (NoSuchAlgorithmException e) { > e.printStackTrace(); > } > } > > > > org.apache.cxf.interceptor.Fault: Could not send Message. > at > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin > gI > nterceptor.handleMessage(MessageSenderInterceptor.java:64) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto > rC > hain.java:220) > at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466) > at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299) > at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251) > at > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) > at $Proxy40.resetContactPassword(Unknown Source) > at my.client.MyClient.invokeService(MyClient.java:91) > at my.client.MyClient.main(MyClient.java:67) > Caused by: javax.net.ssl.SSLHandshakeException: > sun.security.validator.ValidatorException: No trusted certificate found > at > com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:15 > 18 > ) > at > com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174) > at > com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Client > Ha > ndshaker.java:848) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHan > ds > haker.java:106) > at > com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495) > at > com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java > :4 > 33) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.ja > va > :818) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSL > So > cketImpl.java:1030) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl. > java:1057) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl. > java:1041) > at > sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:4 > 02 > ) > at > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect( > Ab > stractDelegateHttpsURLConnection.java:170) > at > sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCon > ne > ction.java:861) > at > sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Http > sU > RLConnectionImpl.java:230) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHe > ad > ersTrustCaching(HTTPConduit.java:1836) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstW > ri > te(HTTPConduit.java:1794) > at > org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOut > pu > tStream.java:42) > at > org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThreshol > dO > utputStream.java:69) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HT > TP > Conduit.java:1854) > at > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) > at > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:595) > at > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin > gI > nterceptor.handleMessage(MessageSenderInterceptor.java:62) > ... 9 more > Caused by: sun.security.validator.ValidatorException: No trusted > certificate found > at > sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidat > or > .java:304) > at > sun.security.validator.SimpleValidator.engineValidate(SimpleValidator. > ja > va:107) > at sun.security.validator.Validator.validate(Validator.java:203) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X > 50 > 9TrustManagerImpl.java:172) > at > com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(S > SL > ContextImpl.java:320) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Client > Ha > ndshaker.java:841) > ... 28 more > > > ====================================================================== > == > ====== > Please access the attached hyperlink for an important electronic > communications disclaimer: > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > ====================================================================== > == > ====== > > ====================================================================== > ======== Please access the attached hyperlink for an important > electronic communications disclaimer: > > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > ====================================================================== > ======== > > > Quoted from: http://www.nabble.com/Not-able-to-ignore---sun.security.validator.Valida torException%3A-No-trusted-certificate-found---tp21563547p21563841.html ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================
