Beginner SSL questions

I am still very much a beginner and this is my first time trying to set SSL up. I am experiencing some issues and I am not really sure what to do. I hope this is the right forum to post this.

When I go to https://xxxx.xxxxx.net/myContext my login index.jsp page displays however

1.) In IE it's not showing the page as secured(no lock).

2.) When I log in using valid credentials the url becomes http://xxxx.xxxxx.net:443/myContext/myServlet

and the page I expect to display doesnt. It only displays this: 

3.) None of my stylesheets are being used.

When I go to http://xxxx.xxxxx.net/myContext my login index.jsp page displays perfectly and I am able to log in and do see the expected page.

Apparently I missed a step somewhere or just the obvious but how do I get my index.jsp to use SSL. Any help would really be appreciated. Thanks in advance

Crystal

SERVER.XML

<Connector port="80"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" redirectPort="443" acceptCount="100"

debug="0" connectionTimeout="20000"

disableUploadTimeout="true" />

<Connector port="443"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="true" disableUploadTimeout="true"

acceptCount="100" debug="0" scheme="https" secure="true"

clientAuth="false" sslProtocol="TLS"

keystoreFile=".IRRS_keystore" keystorePass="thepassword"/>

STDOUT.LOG

May 4, 2007 11:20:38 AM org.apache.coyote.http11.Http11Protocol init

INFO: Initializing Coyote HTTP/1.1 on http-80

May 4, 2007 11:20:39 AM org.apache.coyote.http11.Http11Protocol init

INFO: Initializing Coyote HTTP/1.1 on http-443

May 4, 2007 11:20:39 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 1031 ms

May 4, 2007 11:20:39 AM org.apache.catalina.core.StandardService start

INFO: Starting service Catalina

May 4, 2007 11:20:39 AM org.apache.catalina.core.StandardEngine start

INFO: Starting Servlet Engine: Apache Tomcat/5.5.0

May 4, 2007 11:20:39 AM org.apache.catalina.core.StandardHost start

INFO: XML validation disabled

May 4, 2007 11:20:40 AM org.apache.catalina.core.ApplicationContext log

May 4, 2007 11:20:40 AM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-80

May 4, 2007 11:20:40 AM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-443

May 4, 2007 11:20:40 AM org.apache.jk.common.ChannelSocket init

INFO: JK2: ajp13 listening on /0.0.0.0:8009

May 4, 2007 11:20:40 AM org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=0/15 config=D:\Tomcat5\conf\jk2.properties

May 4, 2007 11:20:40 AM org.apache.catalina.startup.Catalina start

INFO: Server startup in 1313 ms

[3549 byte] By [punnkdorka] at [2007-11-27 3:22:23]
# 1

I forgot to add that I if I go to https://xxxx.xxxxx.net/myContext/admin/index.jsp for the Tomcat administrative piece I see the lock and if I go to https://xxxx.xxxxx.net/ a.k.a. Tomcat/webapps/Root/index.html which I have a JavaScript redirect - it hits a secured area for a split second before redirecting back to the non secured piece.

punnkdorka at 2007-7-12 8:25:08 > top of Java-index,Java Essentials,New To Java...
# 2

Are you intentionally leaving a connector for port 80 open? If you don't need anything to be non-ssl enabled then you should comment out the port 80 connector and just have a connector for port 443. You should then be able to access any of your stuff via https://whatever/whathaveyou...

[edit]

this is an obvious question but you didn't mention it so just in case - you did create a self signed server certificate and import that into the keystore right? (or use a commercial certificate and import that and the CA chain into your trust store)

Message was edited by:

cjmose

cjmosea at 2007-7-12 8:25:08 > top of Java-index,Java Essentials,New To Java...
# 3

Thanks cjmose for responding!

I figured out what I was doing wrong. I had the following lines in my JSP:

<c:set var="domain">

<%= request.getServerName() + ":" + request.getServerPort() + request.getContextPath()%>

</c:set>

<BASE href="http://<c:out value="${domain}"/>/">

I modified the above to correlate with my SSL intention and all is fine. Thanks again for your help and have a good weekend!

Crystal

Message was edited by:

punnkdork

punnkdorka at 2007-7-12 8:25:08 > top of Java-index,Java Essentials,New To Java...