Hi to all,
I need urgent help in implementing SSL encryption!
With the normal HTTP protocol, my application with embedded Tomcat 6 works without problems.
When I insert the following connectors, I can receive the webclient over the URL
HTTP://localhost:8080
and
HTTP://localhost:8443, instead of
https://localhost:8443!
...
/ / Create a connector that listens on all addresses
/ / On port 8080
Connector connector = embedded.createConnector (
(String) null, 8080 false);
/ / Wire up the connector
embedded.addConnector (connector);
/ / Ssl connector
Connector sslConnector embedded.createConnector = (
(Java.net.InetAddress) null, 8443, true);
sslConnector.setProtocol ("TLS");
sslConnector.setSecure (true);
sslConnector.setEnableLookups (false);
sslConnector.setAttribute (keypass "," changeit ");
sslConnector.setAttribute ("keystore", catalina home +
"/ keys / .keystore");
sslConnector.setAttribute (ClientAuth "," false ");
/ / Wire up the sslconnector
embedded.addConnector (sslConnector);
...
I tried also the following version for the sslConnector:
...
Connector sslConnector embedded.createConnector =
((java.net.InetAddress) null, sslPort, true);
IntrospectionUtils.setProperty (sslConnector, "port", "8443");
IntrospectionUtils.setProperty (sslConnector, "SslProtocols", "TLS");
IntrospectionUtils.setProperty (sslConnector,
"keystore file", catalina home + "/ keys / .keystore");
IntrospectionUtils.setProperty (sslConnector,
"keystore pass", "kspass");
IntrospectionUtils.setProperty (sslConnector,
"keystore type", "JKS");
IntrospectionUtils.setProperty (sslConnector, "clientAuth", "false");
IntrospectionUtils.setProperty (this, "SSLEnabled", "true");
embedded.addConnector (sslConnector);
...
With the same result! It causes no errors in both trials. I can't understand the javaworld!
Can someone tell me where I make the mistake and show me a working solution?
Thanks for your helps
Andi