RE: Embedded Tomcat & SSL

2005-06-23 Thread Caldarale, Charles R
> From: Diarmuid McDonald [mailto:[EMAIL PROTECTED] 
> Subject: RE: Embedded Tomcat & SSL
> 
> Unfortunately I havent found a solution. If anyone has done 
> Java Embedded Tomcat using SSL, could they post a simple test program.

Can't really comment about how it's done, but it is possible, since
JBoss supports SSL with its embedded Tomcat.  Perhaps you could browse
through the JBoss doc and code.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Embedded Tomcat & SSL

2005-06-23 Thread Diarmuid McDonald
Hi Freddie,

Unfortunately I havent found a solution. If anyone has done Java Embedded 
Tomcat using SSL, could they post a simple test program.

-Original Message-
From: Freddie Willis [mailto:[EMAIL PROTECTED]
Sent: 21 June 2005 10:23
To: tomcat-user@jakarta.apache.org
Subject: RE: Embedded Tomcat & SSL


Hi Diarmuid,

I was investigating running Embedded Tomcat, I also ran into problems 
running SSL, getting a SSLHandshakeException. Did you find a s solution

Thanx,
Freddie


>-Original Message-
>From: Diarmuid McDonald [mailto:[EMAIL PROTECTED]
>Sent: 09 June 2005 14:40
>To: Tomcat Users List
>Subject: RE: Embedded Tomcat & SSL
>
>
>Hi Mark,
>
>thanks for your replies. Is there any chance you could mail your complete 
>code, for getting embedded Tomcat and SSL working.
>
>I Implemented creating a Connector this way however, I was unsuccessful and 
>got the following Error. I have no idea what property it is looking for.
>
>11:33:36:769: [org.apache.catalina.connector.Connector][main] ERROR - Error 
>registering connector
>java.lang.NullPointerException
> at 
>org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:375)
> at 
>org.apache.catalina.connector.Connector.getProperty(Connector.java:289)
> at 
>org.apache.catalina.connector.Connector.createObjectName(Connector.java:881)
> at 
>org.apache.catalina.connector.Connector.initialize(Connector.java:909)
> at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
> at 
>de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
>72389 [main] ERROR org.apache.catalina.connector.Connector  - Error 
>registering connector
>java.lang.NullPointerException
> at 
>org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:375)
> at 
>org.apache.catalina.connector.Connector.getProperty(Connector.java:289)
> at 
>org.apache.catalina.connector.Connector.createObjectName(Connector.java:881)
> at 
>org.apache.catalina.connector.Connector.initialize(Connector.java:909)
> at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
> at 
>de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
>11:33:36:769: [org.apache.catalina.connector.Connector][main] DEBUG - 
>Creating name for connector nu
>ll
>72389 [main] DEBUG org.apache.catalina.connector.Connector  - Creating name 
>for connector null
>java.lang.NullPointerException
> at 
>org.apache.catalina.connector.Connector.initialize(Connector.java:922)
> at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
> at 
>de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
>
>
>
>
>
>-Original Message-
>From: Mark [mailto:[EMAIL PROTECTED]
>Sent: 08 June 2005 19:09
>To: Tomcat Users List
>Subject: Re: Embedded Tomcat & SSL
>
>
>I followed very closely the Embedded.java found in the tomcat source 
>code...
>Here is the createConnector method
>
>--START--
>   public Connector createConnector( String protocol)
>   {
> Connector connector = null;
> try {
>   connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
>   IntrospectionUtils.setProperty(connector,
>"useURIValidationHack", "" + false);
>   IntrospectionUtils.setProperty(connector, "protocolHandlerClassName",
>
> "org.apache.jk.server.JkCoyoteHandler");
> } catch (Exception e) {
>   e.printStackTrace();
>   log.debug("Couldn't create connector.");
> }
> return (connector);
>   }
>--END--
>
>
>
>On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> > Hi Mark,
> >
> > Im not sure I understand what you mean by mutual authenticated SSL. I 
>set to not be SSL enabled and it made no difference when tring to connect 
>to https://localhost:9012/axis/ . i.e.
> >
> > Connector sshConnector = embedded.createConnector( 
>(java.net.InetAddress)  
>       null,
> >      9012,
> >false);
> >
> > Could you elaborate as to how you got SSL working, or do you have sample 
>code I could use
> >
> >
> > -Original Message-
> > From: Mark [mailto:[EMAIL PROTECTED]
> > Sent: 08 June 2005 16:12
> > To: Tomcat Users List
> > Subject: Re: Embedded Tomcat & SSL
> >
> >
&g

RE: Embedded Tomcat & SSL

2005-06-21 Thread Freddie Willis

Hi Diarmuid,

I was investigating running Embedded Tomcat, I also ran into problems 
running SSL, getting a SSLHandshakeException. Did you find a s solution


Thanx,
Freddie



-Original Message-
From: Diarmuid McDonald [mailto:[EMAIL PROTECTED]
Sent: 09 June 2005 14:40
To: Tomcat Users List
Subject: RE: Embedded Tomcat & SSL


Hi Mark,

thanks for your replies. Is there any chance you could mail your complete 
code, for getting embedded Tomcat and SSL working.


I Implemented creating a Connector this way however, I was unsuccessful and 
got the following Error. I have no idea what property it is looking for.


11:33:36:769: [org.apache.catalina.connector.Connector][main] ERROR - Error 
registering connector

java.lang.NullPointerException
at 
org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:375)
at 
org.apache.catalina.connector.Connector.getProperty(Connector.java:289)
at 
org.apache.catalina.connector.Connector.createObjectName(Connector.java:881)
at 
org.apache.catalina.connector.Connector.initialize(Connector.java:909)

at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
at 
de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
72389 [main] ERROR org.apache.catalina.connector.Connector  - Error 
registering connector

java.lang.NullPointerException
at 
org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:375)
at 
org.apache.catalina.connector.Connector.getProperty(Connector.java:289)
at 
org.apache.catalina.connector.Connector.createObjectName(Connector.java:881)
at 
org.apache.catalina.connector.Connector.initialize(Connector.java:909)

at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
at 
de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
11:33:36:769: [org.apache.catalina.connector.Connector][main] DEBUG - 
Creating name for connector nu

ll
72389 [main] DEBUG org.apache.catalina.connector.Connector  - Creating name 
for connector null

java.lang.NullPointerException
at 
org.apache.catalina.connector.Connector.initialize(Connector.java:922)

at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
at 
de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)






-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]
Sent: 08 June 2005 19:09
To: Tomcat Users List
Subject: Re: Embedded Tomcat & SSL


I followed very closely the Embedded.java found in the tomcat source 
code...

Here is the createConnector method

--START--
  public Connector createConnector( String protocol)
  {
Connector connector = null;
try {
connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
  IntrospectionUtils.setProperty(connector,
"useURIValidationHack", "" + false);
IntrospectionUtils.setProperty(connector, "protocolHandlerClassName",
 
"org.apache.jk.server.JkCoyoteHandler");
} catch (Exception e) {
  e.printStackTrace();
  log.debug("Couldn't create connector.");
}
return (connector);
  }
--END--



On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> Hi Mark,
>
> Im not sure I understand what you mean by mutual authenticated SSL. I 
set to not be SSL enabled and it made no difference when tring to connect 
to https://localhost:9012/axis/ . i.e.

>
> Connector sshConnector = embedded.createConnector( 
(java.net.InetAddress)  
  null,

>  9012,
>false);
>
> Could you elaborate as to how you got SSL working, or do you have sample 
code I could use

>
>
> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]
> Sent: 08 June 2005 16:12
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat & SSL
>
>
> I do not think that you need an SSL connector.  I have an embedded
> tomcat working using mutual authenticated SSL and the connector is not
> SSL enabled.
>
> On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Can anyone help me with regard to running Embedded Tomcat 5.5.9 with 
SSL. I found a mail archive before that has the same problem, however there 
is no resolution.

> >
> > 
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg153661.html

> >
> > I have included my code and errors that I am receiving. Any help would 
be greatly appreciated

> >
> > Here is the code I am Using
> >
> > import java.io.File;
> > ..
> > ..
> > import org.apac

RE: Embedded Tomcat & SSL

2005-06-09 Thread Diarmuid McDonald
Hi Mark,

thanks for your replies. Is there any chance you could mail your complete code, 
for getting embedded Tomcat and SSL working.

I Implemented creating a Connector this way however, I was unsuccessful and got 
the following Error. I have no idea what property it is looking for.

11:33:36:769: [org.apache.catalina.connector.Connector][main] ERROR - Error 
registering connector
java.lang.NullPointerException
at 
org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:375)
at 
org.apache.catalina.connector.Connector.getProperty(Connector.java:289)
at 
org.apache.catalina.connector.Connector.createObjectName(Connector.java:881)
at 
org.apache.catalina.connector.Connector.initialize(Connector.java:909)
at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
at 
de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
72389 [main] ERROR org.apache.catalina.connector.Connector  - Error registering 
connector
java.lang.NullPointerException
at 
org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:375)
at 
org.apache.catalina.connector.Connector.getProperty(Connector.java:289)
at 
org.apache.catalina.connector.Connector.createObjectName(Connector.java:881)
at 
org.apache.catalina.connector.Connector.initialize(Connector.java:909)
at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
at 
de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)
11:33:36:769: [org.apache.catalina.connector.Connector][main] DEBUG - Creating 
name for connector nu
ll
72389 [main] DEBUG org.apache.catalina.connector.Connector  - Creating name for 
connector null
java.lang.NullPointerException
at 
org.apache.catalina.connector.Connector.initialize(Connector.java:922)
at org.apache.catalina.startup.Embedded.start(Embedded.java:794)
at 
de.start.sip.common.TestEmbededTomcat.main(TestEmbededTomcat.java:130)





-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]
Sent: 08 June 2005 19:09
To: Tomcat Users List
Subject: Re: Embedded Tomcat & SSL


I followed very closely the Embedded.java found in the tomcat source code...
Here is the createConnector method 

--START--
  public Connector createConnector( String protocol)
  {
Connector connector = null;
try {
connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
  IntrospectionUtils.setProperty(connector,
"useURIValidationHack", "" + false);
IntrospectionUtils.setProperty(connector, "protocolHandlerClassName",
 
"org.apache.jk.server.JkCoyoteHandler");
} catch (Exception e) {
  e.printStackTrace();
  log.debug("Couldn't create connector.");
}
return (connector);
  }
--END--



On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> Hi Mark,
> 
> Im not sure I understand what you mean by mutual authenticated SSL. I set to 
> not be SSL enabled and it made no difference when tring to connect to 
> https://localhost:9012/axis/ . i.e.
> 
> Connector sshConnector = embedded.createConnector( (java.net.InetAddress) 
>
> null,
>  9012,
>false);
> 
> Could you elaborate as to how you got SSL working, or do you have sample code 
> I could use
> 
> 
> -----Original Message-----
> From: Mark [mailto:[EMAIL PROTECTED]
> Sent: 08 June 2005 16:12
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat & SSL
> 
> 
> I do not think that you need an SSL connector.  I have an embedded
> tomcat working using mutual authenticated SSL and the connector is not
> SSL enabled.
> 
> On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Can anyone help me with regard to running Embedded Tomcat 5.5.9 with SSL. I 
> > found a mail archive before that has the same problem, however there is no 
> > resolution.
> >
> > http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg153661.html
> >
> > I have included my code and errors that I am receiving. Any help would be 
> > greatly appreciated
> >
> > Here is the code I am Using
> >
> > import java.io.File;
> > ..
> > ..
> > import org.apache.tomcat.util.IntrospectionUtils;
> >
> > public class TestEmbededTomcat {
> >
> >
> > public static void main( String args[] )
> > {
> >
> > Embedded embedded = new Embedded();
> >
> > // set default logger and realm
> >   

Re: Embedded Tomcat & SSL

2005-06-08 Thread Mark
I followed very closely the Embedded.java found in the tomcat source code...
Here is the createConnector method 

--START--
  public Connector createConnector( String protocol)
  {
Connector connector = null;
try {
connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
  IntrospectionUtils.setProperty(connector,
"useURIValidationHack", "" + false);
IntrospectionUtils.setProperty(connector, "protocolHandlerClassName",
 
"org.apache.jk.server.JkCoyoteHandler");
} catch (Exception e) {
  e.printStackTrace();
  log.debug("Couldn't create connector.");
}
return (connector);
  }
--END--



On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> Hi Mark,
> 
> Im not sure I understand what you mean by mutual authenticated SSL. I set to 
> not be SSL enabled and it made no difference when tring to connect to 
> https://localhost:9012/axis/ . i.e.
> 
> Connector sshConnector = embedded.createConnector( (java.net.InetAddress) 
>
> null,
>  9012,
>false);
> 
> Could you elaborate as to how you got SSL working, or do you have sample code 
> I could use
> 
> 
> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]
> Sent: 08 June 2005 16:12
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat & SSL
> 
> 
> I do not think that you need an SSL connector.  I have an embedded
> tomcat working using mutual authenticated SSL and the connector is not
> SSL enabled.
> 
> On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Can anyone help me with regard to running Embedded Tomcat 5.5.9 with SSL. I 
> > found a mail archive before that has the same problem, however there is no 
> > resolution.
> >
> > http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg153661.html
> >
> > I have included my code and errors that I am receiving. Any help would be 
> > greatly appreciated
> >
> > Here is the code I am Using
> >
> > import java.io.File;
> > ..
> > ..
> > import org.apache.tomcat.util.IntrospectionUtils;
> >
> > public class TestEmbededTomcat {
> >
> >
> > public static void main( String args[] )
> > {
> >
> > Embedded embedded = new Embedded();
> >
> > // set default logger and realm
> > org.apache.log4j.BasicConfigurator.configure();
> >
> > MemoryRealm memRealm = new MemoryRealm();
> > embedded.setRealm(memRealm);
> >
> > //Create an Engine
> > Engine baseEngine = embedded.createEngine();
> >
> > baseEngine.setName("TestEngine");
> > baseEngine.setDefaultHost("vsjHost");
> >
> > //Create Host
> > Host baseHost =  embedded.createHost( "vsjHost", 
> > "e:/ent/sip2.0/rte/jakarta-tomcat-5.5.9-embed/webapps" );
> >
> > baseEngine.addChild( baseHost );
> >
> > //Create default context
> > Context rootContext = embedded.createContext("","ROOT");
> >
> > baseHost.addChild( rootContext );
> >
> > // Create context for web app for axis
> > Context axisContext = embedded.createContext("/axis", "axis");
> > axisContext.setPrivileged( true );
> > baseHost.addChild( axisContext );
> >
> > embedded.addEngine( baseEngine );
> >
> >   //Create a ssh Connector
> >   Connector sshConnector = embedded.createConnector( 
> > (java.net.InetAddress) null,
> >9012,
> >true);
> >
> > IntrospectionUtils.setProperty(sshConnector, "sslProtocol", "TLS");
> > IntrospectionUtils.setProperty(sshConnector, "keypass", "changeit");
> > IntrospectionUtils.setProperty(sshConnector, "keystore", 
> > "C:/Documents and Settings/mcdonald/.keystore");
> > IntrospectionUtils.setProperty(sshConnector, "clientAuth", "false");
> >
> > embedded.addConnector( sshConnector );
> > sshConnector.setProtocol( "TLS" );
> >
> > //start 

RE: Embedded Tomcat & SSL

2005-06-08 Thread Diarmuid McDonald
Hi Mark,

Im not sure I understand what you mean by mutual authenticated SSL. I set to 
not be SSL enabled and it made no difference when tring to connect to 
https://localhost:9012/axis/ . i.e.

Connector sshConnector = embedded.createConnector( (java.net.InetAddress)   
 null,
 9012,
   false);

Could you elaborate as to how you got SSL working, or do you have sample code I 
could use


-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]
Sent: 08 June 2005 16:12
To: Tomcat Users List
Subject: Re: Embedded Tomcat & SSL


I do not think that you need an SSL connector.  I have an embedded
tomcat working using mutual authenticated SSL and the connector is not
SSL enabled.

On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Can anyone help me with regard to running Embedded Tomcat 5.5.9 with SSL. I 
> found a mail archive before that has the same problem, however there is no 
> resolution.
> 
> http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg153661.html
> 
> I have included my code and errors that I am receiving. Any help would be 
> greatly appreciated
> 
> Here is the code I am Using
> 
> import java.io.File;
> ..
> ..
> import org.apache.tomcat.util.IntrospectionUtils;
> 
> public class TestEmbededTomcat {
> 
> 
> public static void main( String args[] )
> {
> 
> Embedded embedded = new Embedded();
> 
> // set default logger and realm
> org.apache.log4j.BasicConfigurator.configure();
> 
> MemoryRealm memRealm = new MemoryRealm();
> embedded.setRealm(memRealm);
> 
> //Create an Engine
> Engine baseEngine = embedded.createEngine();
> 
> baseEngine.setName("TestEngine");
> baseEngine.setDefaultHost("vsjHost");
> 
> //Create Host
> Host baseHost =  embedded.createHost( "vsjHost", 
> "e:/ent/sip2.0/rte/jakarta-tomcat-5.5.9-embed/webapps" );
> 
> baseEngine.addChild( baseHost );
> 
> //Create default context
> Context rootContext = embedded.createContext("","ROOT");
> 
> baseHost.addChild( rootContext );
> 
> // Create context for web app for axis
> Context axisContext = embedded.createContext("/axis", "axis");
> axisContext.setPrivileged( true );
> baseHost.addChild( axisContext );
> 
> embedded.addEngine( baseEngine );
> 
>   //Create a ssh Connector
>   Connector sshConnector = embedded.createConnector( 
> (java.net.InetAddress) null,
>9012,
>true);
> 
> IntrospectionUtils.setProperty(sshConnector, "sslProtocol", "TLS");
> IntrospectionUtils.setProperty(sshConnector, "keypass", "changeit");
> IntrospectionUtils.setProperty(sshConnector, "keystore", 
> "C:/Documents and Settings/mcdonald/.keystore");
> IntrospectionUtils.setProperty(sshConnector, "clientAuth", "false");
> 
> embedded.addConnector( sshConnector );
> sshConnector.setProtocol( "TLS" );
> 
> //start operation
> embedded.start();
> }
> }
> 
> 
> Here is the error message I get :-
> 
> 12:16:41:375: 
> [org.apache.tomcat.util.net.PoolTcpEndpoint][http-9012-Processor3] DEBUG - 
> Handshake
> ailed
> javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
> at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
> at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
> at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(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 
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.handshake(JSSESocketFactory.java:119)
> at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:520)
> at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.j
> va:80)
> at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:536)

Re: Embedded Tomcat & SSL

2005-06-08 Thread Atul
Hi Mark,
 On a similar note, would you be able to point me on how to get CRL
validator invoked by tomcat 5.x for ssl/mutual.

thnks


On 6/8/05, Mark <[EMAIL PROTECTED]> wrote:
> I do not think that you need an SSL connector.  I have an embedded
> tomcat working using mutual authenticated SSL and the connector is not
> SSL enabled.
> 
> On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Can anyone help me with regard to running Embedded Tomcat 5.5.9 with SSL. I 
> > found a mail archive before that has the same problem, however there is no 
> > resolution.
> >
> > http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg153661.html
> >
> > I have included my code and errors that I am receiving. Any help would be 
> > greatly appreciated
> >
> > Here is the code I am Using
> >
> > import java.io.File;
> > ..
> > ..
> > import org.apache.tomcat.util.IntrospectionUtils;
> >
> > public class TestEmbededTomcat {
> >
> >
> > public static void main( String args[] )
> > {
> >
> > Embedded embedded = new Embedded();
> >
> > // set default logger and realm
> > org.apache.log4j.BasicConfigurator.configure();
> >
> > MemoryRealm memRealm = new MemoryRealm();
> > embedded.setRealm(memRealm);
> >
> > //Create an Engine
> > Engine baseEngine = embedded.createEngine();
> >
> > baseEngine.setName("TestEngine");
> > baseEngine.setDefaultHost("vsjHost");
> >
> > //Create Host
> > Host baseHost =  embedded.createHost( "vsjHost", 
> > "e:/ent/sip2.0/rte/jakarta-tomcat-5.5.9-embed/webapps" );
> >
> > baseEngine.addChild( baseHost );
> >
> > //Create default context
> > Context rootContext = embedded.createContext("","ROOT");
> >
> > baseHost.addChild( rootContext );
> >
> > // Create context for web app for axis
> > Context axisContext = embedded.createContext("/axis", "axis");
> > axisContext.setPrivileged( true );
> > baseHost.addChild( axisContext );
> >
> > embedded.addEngine( baseEngine );
> >
> >   //Create a ssh Connector
> >   Connector sshConnector = embedded.createConnector( 
> > (java.net.InetAddress) null,
> >9012,
> >true);
> >
> > IntrospectionUtils.setProperty(sshConnector, "sslProtocol", "TLS");
> > IntrospectionUtils.setProperty(sshConnector, "keypass", "changeit");
> > IntrospectionUtils.setProperty(sshConnector, "keystore", 
> > "C:/Documents and Settings/mcdonald/.keystore");
> > IntrospectionUtils.setProperty(sshConnector, "clientAuth", "false");
> >
> > embedded.addConnector( sshConnector );
> > sshConnector.setProtocol( "TLS" );
> >
> > //start operation
> > embedded.start();
> > }
> > }
> >
> >
> > Here is the error message I get :-
> >
> > 12:16:41:375: 
> > [org.apache.tomcat.util.net.PoolTcpEndpoint][http-9012-Processor3] DEBUG - 
> > Handshake
> > ailed
> > javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
> > at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
> > at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
> > at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(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 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.handshake(JSSESocketFactory.java:119)
> > at 
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:520)
> > at 
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.j
> > va:80)
> > at 
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> > at java.lang.Thread.run(Thread.java:536)
> > 287423 [http-9012-Processor3] DEBUG 
> > org.apache.tomcat.util.net.PoolTcpEndpoint  - Handshake failed
> > javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
> > at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
> > at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
> > at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(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 
> > org.apache.tomcat.util.net.jsse.JSSESocketFactory.handshake(JSSESocketFactory.java:119)
> > at 
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:520)
> > at 

Re: Embedded Tomcat & SSL

2005-06-08 Thread Mark
I do not think that you need an SSL connector.  I have an embedded
tomcat working using mutual authenticated SSL and the connector is not
SSL enabled.

On 6/8/05, Diarmuid McDonald <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Can anyone help me with regard to running Embedded Tomcat 5.5.9 with SSL. I 
> found a mail archive before that has the same problem, however there is no 
> resolution.
> 
> http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg153661.html
> 
> I have included my code and errors that I am receiving. Any help would be 
> greatly appreciated
> 
> Here is the code I am Using
> 
> import java.io.File;
> ..
> ..
> import org.apache.tomcat.util.IntrospectionUtils;
> 
> public class TestEmbededTomcat {
> 
> 
> public static void main( String args[] )
> {
> 
> Embedded embedded = new Embedded();
> 
> // set default logger and realm
> org.apache.log4j.BasicConfigurator.configure();
> 
> MemoryRealm memRealm = new MemoryRealm();
> embedded.setRealm(memRealm);
> 
> //Create an Engine
> Engine baseEngine = embedded.createEngine();
> 
> baseEngine.setName("TestEngine");
> baseEngine.setDefaultHost("vsjHost");
> 
> //Create Host
> Host baseHost =  embedded.createHost( "vsjHost", 
> "e:/ent/sip2.0/rte/jakarta-tomcat-5.5.9-embed/webapps" );
> 
> baseEngine.addChild( baseHost );
> 
> //Create default context
> Context rootContext = embedded.createContext("","ROOT");
> 
> baseHost.addChild( rootContext );
> 
> // Create context for web app for axis
> Context axisContext = embedded.createContext("/axis", "axis");
> axisContext.setPrivileged( true );
> baseHost.addChild( axisContext );
> 
> embedded.addEngine( baseEngine );
> 
>   //Create a ssh Connector
>   Connector sshConnector = embedded.createConnector( 
> (java.net.InetAddress) null,
>9012,
>true);
> 
> IntrospectionUtils.setProperty(sshConnector, "sslProtocol", "TLS");
> IntrospectionUtils.setProperty(sshConnector, "keypass", "changeit");
> IntrospectionUtils.setProperty(sshConnector, "keystore", 
> "C:/Documents and Settings/mcdonald/.keystore");
> IntrospectionUtils.setProperty(sshConnector, "clientAuth", "false");
> 
> embedded.addConnector( sshConnector );
> sshConnector.setProtocol( "TLS" );
> 
> //start operation
> embedded.start();
> }
> }
> 
> 
> Here is the error message I get :-
> 
> 12:16:41:375: 
> [org.apache.tomcat.util.net.PoolTcpEndpoint][http-9012-Processor3] DEBUG - 
> Handshake
> ailed
> javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
> at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
> at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
> at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(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 
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.handshake(JSSESocketFactory.java:119)
> at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:520)
> at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.j
> va:80)
> at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:536)
> 287423 [http-9012-Processor3] DEBUG 
> org.apache.tomcat.util.net.PoolTcpEndpoint  - Handshake failed
> javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
> at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
> at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
> at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(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 
> org.apache.tomcat.util.net.jsse.JSSESocketFactory.handshake(JSSESocketFactory.java:119)
> at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:520)
> at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.j
> va:80)
> at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:536)
> 
> 
> Here is the message I get from Firefox :-
> 
> "Could not establish an encrypted connection, because the certificate 
> presented by lo

Re: Embedded Tomcat & SSL

2005-05-31 Thread tom ONeill

Hi Aleksandar,

When I enabled logging using the BasicConfigurator I now get much more 
logging information (how exactly the logging is configured and what impact 
the value of CATALINA_HOME has I havent been able to figure out but Im sure 
Ill get it eventually).


Anyway the exception being displayed is

/

179070 [http-443-Processor4] DEBUG 
org.apache.tomcat.util.net.PoolTcpEndpoint  - Handshake

failed
javax.net.ssl.SSLHandshakeException: Remote host closed connection during 
handshake

   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)




Im guessing this exception is occurring because the server is trying to 
authenticate the client and expects the client to send a certificate so I 
updated my code by adding the line


IntrospectionUtils.setProperty(httpConnector, "clientauth", "false");

This hasnt resolved my problem but Im sure Ill figure it out eventually. 
Thanks for all your help.


Tom



From: Aleksandar Valchev <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" 
To: "Tomcat Users List" 
Subject: Re: Embedded Tomcat & SSL
Date: Tue, 31 May 2005 13:14:14 +0300

On Tuesday 31 May 2005 12:39, tom ONeill wrote:
You see tomcat home page on http://localhost:443/  because tomcat redirects
connection (I think so :) ).

I test this on jakarta-tomcat-5.5.9-embedded:

Connector httpConnector = new Connector();

httpConnector.setScheme("https");
httpConnector.setSecure(true);
httpConnector.setEnableLookups(false);

IntrospectionUtils.setProperty(httpConnector, "sslProtocol", "TLS");
IntrospectionUtils.setProperty(httpConnector, "keypass", "changeit");
IntrospectionUtils.setProperty(httpConnector, "keystore", "C:/Documents and
Settings/tom/.keystore");
IntrospectUtils.setProperty(httpConnector, "address",
InetAddress.getLocalhost());
IntrospectUtils.setProperty(httpConnector, "port", ""+443);

Of course you have to create your keystore according to tomcat-5.5.9
documentation.

See in your logs. There has to be errors. To see more tomcat messages while
tomcat starts add at the top of your code BasicConfigurator.configure(). 
This

line configures commons-logging to output debug messages.

If you see "Cannot find server", I think the problem is in your 
httpConnector.

While tomcat starts it looks for certificate and private key and if it does
not find it connector just would not start.

I advise you to see your logs ($CATALINA_HOME/logs directory) more 
carefully.


> Hi Aleksandar,
>
> Thanks for this. When I update my code to do this I still cannot connect
> from a browser using HTTPS (https://localhost:443/). I get a "Cannot 
find

> server error" in my browser.
> But if I change my URL so that I use HTTP (http://localhost:443/) I can 
see

> the Tomcat homepage. Seems like Tomcat is still only able to handle http
> requests even though I think I have enabled it for SSL.
>
> I have included a extract of my code to illustrate what I am doing.
>
>
> 
///

>///
>
>
> Connector httpConnector = embedded.createConnector(
> (java.net.InetAddress) null,
>  443,
>  true);
>
> IntrospectionUtils.setProperty(httpConnector, "sslProtocol",
> "TLS"); IntrospectionUtils.setProperty(httpConnector, "keypass",
> "changeit");
> IntrospectionUtils.setProperty(httpConnector, "keystore",
> "C:/Documents and Settings/tom/.keystore");
>
>
> embedded.addConnector( httpConnector );
>
>embedded.start();
>
>
>
> 
///////////////

>///
>
>
> Any ideas what I am doing wrong (I forgot to mention that I am using
> embedded Tomcat 5.5.9).
>
> Cheers,
> Tom
>
> >From: Aleksandar Valchev <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" 
> >To: "Tomcat Users List" 
> >Subject: Re: Embedded Tomcat & SSL
> >Date: Tue, 31 May 2005 11:55:42 +0300
> >
> >You have to tell tomcat where to find keystore file:
> >
> >IntrospectionUtils.setProperty(connector, "sslProtocol", "TLS");
> >IntrospectionUtils.setProperty(connector, "keyp

Re: Embedded Tomcat & SSL

2005-05-31 Thread Aleksandar Valchev
On Tuesday 31 May 2005 12:39, tom ONeill wrote:
You see tomcat home page on http://localhost:443/  because tomcat redirects 
connection (I think so :) ).

I test this on jakarta-tomcat-5.5.9-embedded:

Connector httpConnector = new Connector();

httpConnector.setScheme("https");
httpConnector.setSecure(true);
httpConnector.setEnableLookups(false);

IntrospectionUtils.setProperty(httpConnector, "sslProtocol", "TLS"); 
IntrospectionUtils.setProperty(httpConnector, "keypass", "changeit");
IntrospectionUtils.setProperty(httpConnector, "keystore", "C:/Documents and 
Settings/tom/.keystore");
IntrospectUtils.setProperty(httpConnector, "address", 
InetAddress.getLocalhost());
IntrospectUtils.setProperty(httpConnector, "port", ""+443);

Of course you have to create your keystore according to tomcat-5.5.9 
documentation. 

See in your logs. There has to be errors. To see more tomcat messages while 
tomcat starts add at the top of your code BasicConfigurator.configure(). This 
line configures commons-logging to output debug messages.

If you see "Cannot find server", I think the problem is in your httpConnector. 
While tomcat starts it looks for certificate and private key and if it does 
not find it connector just would not start.

I advise you to see your logs ($CATALINA_HOME/logs directory) more carefully.

> Hi Aleksandar,
>
> Thanks for this. When I update my code to do this I still cannot connect
> from a browser using HTTPS (https://localhost:443/). I get a "Cannot find
> server error" in my browser.
> But if I change my URL so that I use HTTP (http://localhost:443/) I can see
> the Tomcat homepage. Seems like Tomcat is still only able to handle http
> requests even though I think I have enabled it for SSL.
>
> I have included a extract of my code to illustrate what I am doing.
>
>
> ///
>///
>
>
> Connector httpConnector = embedded.createConnector(
> (java.net.InetAddress) null,
>  443,
>  true);
>
> IntrospectionUtils.setProperty(httpConnector, "sslProtocol",
> "TLS"); IntrospectionUtils.setProperty(httpConnector, "keypass",
> "changeit");
> IntrospectionUtils.setProperty(httpConnector, "keystore",
> "C:/Documents and Settings/tom/.keystore");
>
>
> embedded.addConnector( httpConnector );
>
>embedded.start();
>
>
>
> ///////////
>///
>
>
> Any ideas what I am doing wrong (I forgot to mention that I am using
> embedded Tomcat 5.5.9).
>
> Cheers,
> Tom
>
> >From: Aleksandar Valchev <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" 
> >To: "Tomcat Users List" 
> >Subject: Re: Embedded Tomcat & SSL
> >Date: Tue, 31 May 2005 11:55:42 +0300
> >
> >You have to tell tomcat where to find keystore file:
> >
> >IntrospectionUtils.setProperty(connector, "sslProtocol", "TLS");
> >IntrospectionUtils.setProperty(connector, "keypass", "keystore-password");
> >IntrospectionUtils.setProperty(connector, "keystore", "path-to-keystore");
> >
> >Hope this helps
> >Aleksandar
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
> _
> It's finally here! Download Messenger 7.0 - still FREE
> http://messenger.msn.co.uk
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Embedded Tomcat & SSL

2005-05-31 Thread tom ONeill

Hi Aleksandar,

Thanks for this. When I update my code to do this I still cannot connect
from a browser using HTTPS (https://localhost:443/). I get a "Cannot find
server error" in my browser.
But if I change my URL so that I use HTTP (http://localhost:443/) I can see
the Tomcat homepage. Seems like Tomcat is still only able to handle http
requests even though I think I have enabled it for SSL.

I have included a extract of my code to illustrate what I am doing.


//


   Connector httpConnector = embedded.createConnector(
(java.net.InetAddress) null,
443,
true);

   IntrospectionUtils.setProperty(httpConnector, "sslProtocol", "TLS");
   IntrospectionUtils.setProperty(httpConnector, "keypass",
"changeit");
   IntrospectionUtils.setProperty(httpConnector, "keystore",
"C:/Documents and Settings/tom/.keystore");


   embedded.addConnector( httpConnector );

  embedded.start();



//


Any ideas what I am doing wrong (I forgot to mention that I am using
embedded Tomcat 5.5.9).

Cheers,
Tom



From: Aleksandar Valchev <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" 
To: "Tomcat Users List" 
Subject: Re: Embedded Tomcat & SSL
Date: Tue, 31 May 2005 11:55:42 +0300

You have to tell tomcat where to find keystore file:

IntrospectionUtils.setProperty(connector, "sslProtocol", "TLS");
IntrospectionUtils.setProperty(connector, "keypass", "keystore-password");
IntrospectionUtils.setProperty(connector, "keystore", "path-to-keystore");

Hope this helps
Aleksandar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



_
Start dating right now with FREE Match.com membership! http://match.msn.ie


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Embedded Tomcat & SSL

2005-05-31 Thread tom ONeill

Hi Aleksandar,

Thanks for this. When I update my code to do this I still cannot connect 
from a browser using HTTPS (https://localhost:443/). I get a "Cannot find 
server error" in my browser.
But if I change my URL so that I use HTTP (http://localhost:443/) I can see 
the Tomcat homepage. Seems like Tomcat is still only able to handle http 
requests even though I think I have enabled it for SSL.


I have included a extract of my code to illustrate what I am doing.


//


   Connector httpConnector = embedded.createConnector( 
(java.net.InetAddress) null,

443,
true);

   IntrospectionUtils.setProperty(httpConnector, "sslProtocol", "TLS");
   IntrospectionUtils.setProperty(httpConnector, "keypass", 
"changeit");
   IntrospectionUtils.setProperty(httpConnector, "keystore", 
"C:/Documents and Settings/tom/.keystore");



   embedded.addConnector( httpConnector );

  embedded.start();



//


Any ideas what I am doing wrong (I forgot to mention that I am using 
embedded Tomcat 5.5.9).


Cheers,
Tom



From: Aleksandar Valchev <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" 
To: "Tomcat Users List" 
Subject: Re: Embedded Tomcat & SSL
Date: Tue, 31 May 2005 11:55:42 +0300

You have to tell tomcat where to find keystore file:

IntrospectionUtils.setProperty(connector, "sslProtocol", "TLS");
IntrospectionUtils.setProperty(connector, "keypass", "keystore-password");
IntrospectionUtils.setProperty(connector, "keystore", "path-to-keystore");

Hope this helps
Aleksandar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



_
It's finally here! Download Messenger 7.0 - still FREE 
http://messenger.msn.co.uk



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Embedded Tomcat & SSL

2005-05-31 Thread Aleksandar Valchev
You have to tell tomcat where to find keystore file:

IntrospectionUtils.setProperty(connector, "sslProtocol", "TLS");
IntrospectionUtils.setProperty(connector, "keypass", "keystore-password");
IntrospectionUtils.setProperty(connector, "keystore", "path-to-keystore");

Hope this helps
Aleksandar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]