aspose file tools*
The moose likes Tomcat and the fly likes TOMCAT SSL - beginner problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "TOMCAT SSL - beginner problem" Watch "TOMCAT SSL - beginner problem" New topic
Author

TOMCAT SSL - beginner problem

marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 178

I cannot get a simple SSL exercise (from Murarch's Servlets and JSP 2nd ed P529) to work.

1) My servlet.xml contains


2) I then generated my keystore file as follows, using "changeit" as my password(s)


3) Then, after restarting TOMCAT my http 8080 port works fine as such


4) But my secure https 8443 port doesn't like this


5) Interestingly, a http 8443 works OK


Is anybody able to help?

Thanks

Marten

[ April 05, 2008: Message edited by: marten kay ]

[ April 05, 2008: Message edited by: marten kay ]

[ April 05, 2008: Message edited by: marten kay ]
[ April 05, 2008: Message edited by: marten kay ]

when in doubt put it in parenthesis and stick a dollar sign in front of it, only good can come from this.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You need to add keystoreFile and keystorePass to the <Connector ../> tag in your server.xml file.

keystoreFile needs to contain the full path and filename of your keystore and the keystorePass, obviously, needs to contain the password that you used when you created it.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 178

Thanks Ben,

I had tried something similar, based on one of your earlier posts.

So, I created my keystore.kdb using
C:\Program Files\Java\jdk1.6.0\bin>keytool -genkey -alias tomcat -keyalg RSA -keystore ./keystore.kdb

then my server.xml has


I restart Tomcat, then https://localhost:8443/ still can't load a page.

Any other ideas?
marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 178

...and then I made a mistake in my password!

It works now thanks for your help
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Glad it's working.
Thanks for posting back with the solution.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

One quirk I thought I'd mention.

The first and last name field should actually be the domain that you will use to access the server. In your case, if you put in 'localhost', you will avoid one of the error messages that the browser will popup. The other is that the certificate authority is unknown. There is not getting around that with a self signed cert.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TOMCAT SSL - beginner problem