You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Mayne, Peter" <Pe...@ap.spherion.com> on 2003/05/07 09:14:55 UTC

Using my own TrustManager for SSL doesn't work in Tomcat

Tomcat 4.1.24-LE, Sun JDK 1.4.1_01-b01, Windows XP

I need to install my own TrustManager to handle SSL.

If I write a standalone test program to use my own TrustManager (with
HttpURLConnection), it works fine.

If I install my own TrustManager in a servlet (with Sun's SOAP classes,
which use HttpURLConnection), the result is exactly as if I hadn't installed
my TrustManager at all. (I know it's being installed, I have debugging all
over the place.)

One thing I've noticed is that my standalone program uses
sun.net.www.protocol.https.HttpsURLConnectionImpl as the underlying
implementation, but the servlet inside Tomcat uses
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl. Maybe
HttpsURLConnectionOldImpl ignores user-installed TrustManagers?

Part of the stack trace from the standalone program:
        at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.doConnect(DashoA6275)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
        at sun.net.www.protocol.https.HttpsClient.<init>(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
        at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.plainConnect(D
ashoA6275)
        at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA
6275)
        at
sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(DashoA6275)
        at SslClient.main(SslClient.java:133)

Part of the stack trace from the servlet:
javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: Couldn't find trusted certificate
	at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
	at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA
6275)
	at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnectio
n.java:528)
	at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getOut
putStream(DashoA6275)
	at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnec
tion.java:247)
	at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run
(HttpSOAPConnection.java:142)
	at java.security.AccessController.doPrivileged(Native Method)
	at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnec
tion.java:115)

Is this anything to do with Tomcat, or is there something else going on?

Thanks.

PJDM
-- 
Peter Mayne
Technology Consultant
Spherion Technology Solutions
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602
T: 61 2 62689727  F: 61 2 62689777
The information contained in this email and any attachments to it:

(a) may be confidential and if you are not the intended recipient, any interference with, 
use, disclosure or copying of this material is unauthorised and prohibited; and

(b) may contain personal information of the recipient and/or the sender as defined 
under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to 
collect, hold and use such information and any personal information contained in a 
response to this email, for any reasonable purpose in the ordinary course of 
Spherion's 
business, including forwarding this email internally or disclosing it to a third party. All 
personal information collected by Spherion will be handled in accordance with 
Spherion's Privacy Policy. If you have received this email in error, please notify the 
sender and delete it.

(c) you agree not to employ or arrange employment for any candidate(s) supplied in 
this email and any attachments without first entering into a contractual agreement with 
Spherion. You further agree not to divulge any information contained in this document 
to any person(s) or entities without the express permission of Spherion.




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org