tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: Embedded tomcat with HTTPS
Date Mon, 11 Aug 2003 01:06:37 GMT
I'm going to assume that you're using 4.1.x.  In this case, you are using
the wrong Factory.  You want something like:

  Connector httpsConnector = embeddedTomcat.createConnector(null,

configuration.getHttpsPort(), true);
  CoyoteServerSocketFactory serverSocketFactory =

(CoyoteServerSocketFactory)httpsConnector.getFactory();
  serverSocketFactory.setKeystoreFile(configuration.getKeystoreFile());
  serverSocketFactory.setKeystorePass("antares");

----- Original Message ----- 
From: "Wesley Hall" <wesley.hall@prociss.co.uk>
To: <tomcat-dev@jakarta.apache.org>
Sent: Sunday, August 10, 2003 1:23 PM
Subject: Embedded tomcat with HTTPS


> Hello,
>       Myself and a collegue are currently working on an open source
> application, part of which involves embedding a servlet engine. I have
read
> through some tutorials and the API docs for tomcat and began development
of
> a class structure to provide this.
>
> I have, however come across a problem with my https connector. I currently
> have code that looks like this..
>
> Connector httpsConnector = embeddedTomcat.createConnector(null,
> configuration.getHttpsPort(), true);
> httpsConnector.setScheme("https");
> SSLServerSocketFactory serverSocketFactory = new SSLServerSocketFactory();
> serverSocketFactory.setKeystoreFile(configuration.getKeystoreFile());
> serverSocketFactory.setKeystorePass("antares");
> httpsConnector.setFactory(serverSocketFactory);
> embeddedTomcat.addConnector(httpsConnector);
> connectors.add(httpsConnector);
>
> configuration is a instance of a simple bean, getHttpsPort() returns 443,
> getKeystoreFile() returns the path to the keystore (generated as per the
> SSL-Howto doc). The location of the keystore is validated elsewhere in the
> code using a File object and a call to .isFile() and .canRead(), both of
> which return true when running this code.
>
> However... i am finding that although http://localhost:443 works
perfectly,
> https://localhost leaves the browser (MSIE) whirring away for 30 seconds
or
> so before displaying 'cannot find server'. With the former i get plenty of
> information in the logs but the latter adds nothing at all to the logs,
> making this problem very difficult to debug. I can change the keystore
pass
> to any value and there is no appreciable difference.
>
> Im happy to provide any more information as required...
>
> Would a kind sameritan type point me in the write direction as to what may
> be causing this issue?
>
> Regards Wesley I. Hall.
>
> P.S. I thought long and hard on whether this belonged on dev or user, but
> since we are discussing actually class structure i finally decided that
dev
> would probably be more appropriate. If i was wrong on that descision, you
> have my sincere apologies.
>
>
> ---------------------------------------------------------------------
> 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