Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TOMCAT SSL - beginner problem

 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and then I made a mistake in my password!

It works now thanks for your help
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad it's working.
Thanks for posting back with the solution.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic