Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat and SSL

Status
Not open for further replies.

binnyms

Programmer
Jun 3, 2003
2
IN
I am trying to set up SSL for stand alone tomcat(3.2.4) and I am using jdk1.2.2 (solaris). I have installed jsse and created keystores like this

genkey -alias tomcat-sv -keyalg RSA -keypass changeit -storepass changeit -keystore server.keystore

keytool -export -alias tomcat-sv -storepass changeit -file server.cer -keystore server.keystore

keytool -genkey -alias tomcat-cl -keyalg RSA -keypass changeit -storepass changeit -keystore client.keystore

keytool -export -alias tomcat-cl -storepass changeit -file client.cer -keystore client.keystore

keytool -import -v -trustcacerts -alias tomcat -file server.cer -keystore client.keystore -keypass changeit - storepass changeit

keytool -import -v -trustcacerts -alias tomcat -file client.cer -keystore server.keystore -keypass changeit -storepass changeit

and I changed server.xml of tomcat like

<Parameter name=&quot;keystore&quot;
value=&quot;/user/path/server.keystore&quot; /> <Parameter name=&quot;keypass&quot; value=&quot;changeit&quot;/>
and restarted tomcat
when I tried to access tomcat from the browser giving
The browser is giving &quot;the page cannot be displayed&quot; error and at the console the error msg is

<b>&quot;2003-06-03 12:48:20 - Ctx( ): 400 R( /) null 2003-06-03 12:48:20 - Ctx( ): IOException in: R( /) Socket closed&quot; </b>

what could be the problem??? pls help
binny
 
Err ... Can you run https on port 8443 ? I thought it was just plain 443 ?

Is there something I did'nt know about here I ask myself?

Have you tried just 443 ?

Good Luck,
Laurie.
 
Thanx. but I have tried 443 also. Getting the same error msg.
 
Take a look here ... will this help:


Sorry for pointing at another forum but heres a cut & paste for those dedicated Tek-Tips people .....

Answer
For allowing only HTTPS (secure) connections, you need to activate Tomcat's the SSL support. If you need help on this, just refer to the Tomcat SSL Configuration HOW-TO documentation pages.
Then, you need to add


<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

to your web application descriptor (web.xml) and change the url-pattern to match the directory you want to access only via HTTPS.
Please, keep in mind that since the web application descriptor is an XML file, attributes definition order is important. All attributes are optional but defining them in the wrong place may prevent your application to act as you expect.


Good Luck,
Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top