tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20690] New: - Custom TrustManager for SSL not being used in Tomcat
Date Wed, 11 Jun 2003 19:49:40 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20690>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20690

Custom TrustManager for SSL not being used in Tomcat

           Summary: Custom TrustManager for SSL not being used in Tomcat
           Product: Tomcat 4
           Version: 4.1.24
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: nathanc@tni.com


I have coded a custom TrustManger and HostnameVerifier for SSL (actually TLS)
connections from my servlet code to another server.

The code calls the correct methods to setup the Default TrustManager and
HostNameVerifier for an HttpsUrlConnection.

I then use the URL.openConnection() method to instansiate the connection.

Running standalone, this code works perfectly, however running under Tomcat on
the same machine the HttpConnection does not use the custom TustManager that I
coded.

Code to set up default Trust Manager, etc.:

private static void initSSL()
{
  try
  {
    TrustManager[] myTM = new TrustManager [] { new ProxyTrustManager() };
    SSLContext ctx = SSLContext.getInstance("TLS");
    ctx.init(null, myTM, null);
    SSLSocketFactory sslFactory = ctx.getSocketFactory();
    HttpsURLConnection.setDefaultSSLSocketFactory(sslFactory);
    HttpsURLConnection.setDefaultHostnameVerifier(new ProxyHostNameVerifier());
  }
  catch (Exception ex)
  {
    ex.printStackTrace();
  }
}


Machine Specs.:
Red-Hat Linux 7.1
J2SDK SE 1.4.1_02

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


Mime
View raw message