You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lm...@yahoo.com on 2005/10/06 20:23:30 UTC
Embedded Tomcat and SSL?
Hi,
I am using an embedded tomcat instance within my application. I am
trying to set up a connector using SSL. When I start the server, it
creates the connector and bind to the port successfully. When I request
a page from the web browser, I get the following error in my browser:
"The connection to the server has terminated unexpectedly. Some data
may have been transferred."
The same scenario works fine with HTTP.
Here is my code snippet:
// APPPORT and isSSLEnabled are set correctly to 8443 and true.
Connector httpConnector =
this._server.createConnector((java.net.InetAddress)null,
Integer.parseInt(ApplicationResourcesUtil.getProperty(Constants.RESOURCEKEY_APPPORT)),isSSLEnabled);
//add new Connector to set of Connectors for embedded server,
associated with Engine
this._server.addConnector(httpConnector);
this._server.start();
Looking at the tomcat website, they talk about registering keystore.
What APIs do I use to programmatically specify the keystore file? Is
there something else that needs to be configured before SSL will work
in the embedded more?
Thanks,
-Andy
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
SocketException: Invalid argument
Posted by Luis Torres <A0...@itesm.mx>.
Hello everyone,
I have a question regarding an error I'm seeing more every day in my
catalina.out
11/10/2005 12:08:34 PM org.apache.tomcat.util.net.TcpWorkerThread runIt
GRAVE: Remote Host /10.49.156.64 SocketException: Invalid argument
It happens with diverse IP addresses, both inside our NAT and outside of
it. The server is not behind a firewall and has a public IP address.
The setup is: Tomcat 4.131, default ports, JDK 1.5.0 update 2, Solaris 9
There's only one application on that server and it hasn't been modified
in some weeks and looking in the web I found ppl with the same problem
but so far no solutions.
Any ideas?
Luis
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Embedded Tomcat and SSL?
Posted by lm...@yahoo.com.
I am using Tomcat as standalone and not with Apache.
I got it to work after playing with it for a while.
You have to set these undocumented properties to get SSL working
properly:
if (isSSLEnabled) {
IntrospectionUtils.setProperty(httpConnector, "sslProtocol",
"TLS");
IntrospectionUtils.setProperty(httpConnector, "keystoreFile",
getPath()+"/conf/tomcat.keystore");
IntrospectionUtils.setProperty(httpConnector, "keystoreType",
"JKS");
IntrospectionUtils.setProperty(httpConnector, "clientAuth",
"false");
httpConnector.setProtocol( "SSL");
}
HTH
--- Mark <el...@gmail.com> wrote:
> are you using Apace with Tomcat? I have done embedded Tomcat and
> SSL,
> but it was Apache sitting in front of Tomcat.
>
> On 10/6/05, lmuxer-mailinglists@yahoo.com
> <lm...@yahoo.com> wrote:
> > Hi,
> >
> > I am using an embedded tomcat instance within my application. I am
> > trying to set up a connector using SSL. When I start the server, it
> > creates the connector and bind to the port successfully. When I
> request
> > a page from the web browser, I get the following error in my
> browser:
> >
> > "The connection to the server has terminated unexpectedly. Some
> data
> > may have been transferred."
> >
> > The same scenario works fine with HTTP.
> >
> > Here is my code snippet:
> > // APPPORT and isSSLEnabled are set correctly to 8443 and true.
> > Connector httpConnector =
> > this._server.createConnector((java.net.InetAddress)null,
> >
>
Integer.parseInt(ApplicationResourcesUtil.getProperty(Constants.RESOURCEKEY_APPPORT)),isSSLEnabled);
> >
> > //add new Connector to set of Connectors for embedded server,
> > associated with Engine
> > this._server.addConnector(httpConnector);
> > this._server.start();
> >
> > Looking at the tomcat website, they talk about registering
> keystore.
> > What APIs do I use to programmatically specify the keystore file?
> Is
> > there something else that needs to be configured before SSL will
> work
> > in the embedded more?
> >
> > Thanks,
> >
> > -Andy
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Embedded Tomcat and SSL?
Posted by Mark <el...@gmail.com>.
are you using Apace with Tomcat? I have done embedded Tomcat and SSL,
but it was Apache sitting in front of Tomcat.
On 10/6/05, lmuxer-mailinglists@yahoo.com <lm...@yahoo.com> wrote:
> Hi,
>
> I am using an embedded tomcat instance within my application. I am
> trying to set up a connector using SSL. When I start the server, it
> creates the connector and bind to the port successfully. When I request
> a page from the web browser, I get the following error in my browser:
>
> "The connection to the server has terminated unexpectedly. Some data
> may have been transferred."
>
> The same scenario works fine with HTTP.
>
> Here is my code snippet:
> // APPPORT and isSSLEnabled are set correctly to 8443 and true.
> Connector httpConnector =
> this._server.createConnector((java.net.InetAddress)null,
> Integer.parseInt(ApplicationResourcesUtil.getProperty(Constants.RESOURCEKEY_APPPORT)),isSSLEnabled);
>
> //add new Connector to set of Connectors for embedded server,
> associated with Engine
> this._server.addConnector(httpConnector);
> this._server.start();
>
> Looking at the tomcat website, they talk about registering keystore.
> What APIs do I use to programmatically specify the keystore file? Is
> there something else that needs to be configured before SSL will work
> in the embedded more?
>
> Thanks,
>
> -Andy
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org