Bug 899445 (JBEWS-52) - EWS on Windows - Tomcat SSL doesn't work when started as a service
Summary: EWS on Windows - Tomcat SSL doesn't work when started as a service
Keywords:
Status: CLOSED EOL
Alias: JBEWS-52
Product: JBoss Enterprise Web Server 1
Classification: JBoss
Component: unspecified
Version: EWS 1.0.2
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: Rebecca Newton
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBE...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-16 23:55 UTC by Ondřej Žižka
Modified: 2017-08-04 14:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Both Tomcat 5 and 6, Windows 2k8 R2 Datacenter
Last Closed: 2017-08-04 14:55:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
tomcat5-stderr.2011-06-16.log (9.05 KB, text/plain)
2011-06-17 00:05 UTC, Ondřej Žižka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEWS-52 0 Critical Closed EWS on Windows - Tomcat SSL doesn't work when started as a service 2017-08-04 14:54:41 UTC
Red Hat Issue Tracker JBQA-4819 0 Blocker Closed Smoke test EWS 1.0.2-CR5 on Windows 2008 2017-08-04 14:54:41 UTC

Description Ondřej Žižka 2011-06-16 23:55:39 UTC
Workaround Description: Add path to EWS's bin directory to `PATH` env var of the user under which the service runs (SYSTEM by default).
project_key: JBEWS

STR:
1) Configure SSL as per https://tcms.engineering.redhat.com/case/5559/?from_plan=583
2) Run it using startup.sh, check SSL   https://localhost:8443/
3) Install Tomcat's as services
4) Run it as service
5) Reload https://localhost:8443/ - server is not listening on that port

Caused by Tomcat using JSSE, looking for .keystore at incorrect  path:

{code}
SEVERE: Error initializing endpoint
java.io.FileNotFoundException: C:\.keystore (The system cannot find the file specified)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:120)
	at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:325)
{code}

See attached log.

Comment 1 Ondřej Žižka 2011-06-17 00:05:55 UTC
Attachment: Added: tomcat5-stderr.2011-06-16.log


Comment 2 Ondřej Žižka 2011-06-17 00:39:54 UTC
Link: Added: This issue relates to JBQA-4819


Comment 3 Rajesh Rajasekaran 2011-06-17 02:16:35 UTC
Ondrej, is this a regression from previous build?

Comment 4 Mladen Turk 2011-06-17 04:41:57 UTC
When running tomcat as a service you HAVE to explicitly define the
keystoreFile="path\.keystore" in the JSSE <connector>
or change the service to use a different account then SYSTEM.

Comment 5 Ondřej Žižka 2011-06-17 11:00:43 UTC
Not a regression;  I just got to a different environment.

Comment 6 Ondřej Žižka 2011-06-17 11:33:25 UTC
Okay, but the question is, why it's using JSSE? 
There's no .keystore in C:\Users\** .
>From what I can tell, it should use APR based on the current server.xml.

How do I persuade Tomcat to use APR then? I read in docs that it's done by SSLEngine="on"
http://tomcat.apache.org/tomcat-6.0-doc/apr.html

       <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />

Could you please check?

Comment 7 Ondřej Žižka 2011-06-17 11:34:43 UTC
Also, I have set the service to use Administrator account under which I tried startup.sh, and it does not work either. Something is causing Tomcat to use JSSE when run as service.

Comment 8 Mladen Turk 2011-06-17 11:53:25 UTC
Now I'm totally lost.
Can we discuss that outside the Jira cause this certainly doesn't fall under the Jira category.


Comment 9 Ondřej Žižka 2011-06-17 12:49:23 UTC
Okay, so this is one more thing to add to docs:
{quote}
The service mode need C:\Program Files\Red Hat\Enterprise Web Server\bin in the system environment PATH to be able to work.
{quote}
Putting to Release notes.

This requirement might be removed in future EWS releases by this:
https://issues.apache.org/jira/browse/DAEMON-209

Comment 10 Ondřej Žižka 2011-06-17 12:58:33 UTC
Release Notes Text: Added: On Windows, Tomcat needs to have the `<EWS_HOME>\bin` directory added to the `PATH` env var of the user under which the service runs (SYSTEM by default).
Without that, JVM fails to find the `libtcnative-1.dll` and resorts to default JSSE connector for SSL. Through this connector, JVM then fails to find the `.keystore` file under the default location, which is current user's home, which is `C:\` for the SYSTEM user. Due to that, SSL connector does not work.

This might be fixed in future Enterprise Web Server release.
Workaround Description: Added: Add path to EWS's bin directory to `PATH` env var of the user under which the service runs (SYSTEM by default).


Comment 11 Ondřej Žižka 2011-06-17 13:00:19 UTC
Release Notes Docs Status: Added: Documented as Known Issue
Release Notes Text: Removed: On Windows, Tomcat needs to have the `<EWS_HOME>\bin` directory added to the `PATH` env var of the user under which the service runs (SYSTEM by default).
Without that, JVM fails to find the `libtcnative-1.dll` and resorts to default JSSE connector for SSL. Through this connector, JVM then fails to find the `.keystore` file under the default location, which is current user's home, which is `C:\` for the SYSTEM user. Due to that, SSL connector does not work.

This might be fixed in future Enterprise Web Server release. Added: On Windows, Tomcat needs to have the `<EWS_HOME>\bin` directory added to the `PATH` env var of the user under which the service runs (SYSTEM by default).
Without that, JVM fails to find the `libtcnative-1.dll` and resorts to default JSSE connector for SSL. Through this connector, JVM then fails to find the `.keystore` file under the default location, which is current user's home, which is `C:\` for the SYSTEM user. Due to that, SSL connector does not work.

This requirement will be removed in future Enterprise Web Server release.


Comment 12 Ondřej Žižka 2011-06-17 13:15:44 UTC
Release Notes Docs Status: Removed: Documented as Known Issue Added: Not Yet Documented
Release Notes Text: Removed: On Windows, Tomcat needs to have the `<EWS_HOME>\bin` directory added to the `PATH` env var of the user under which the service runs (SYSTEM by default).
Without that, JVM fails to find the `libtcnative-1.dll` and resorts to default JSSE connector for SSL. Through this connector, JVM then fails to find the `.keystore` file under the default location, which is current user's home, which is `C:\` for the SYSTEM user. Due to that, SSL connector does not work.

This requirement will be removed in future Enterprise Web Server release. Added: **This should go to docs, not Release Notes.** I just don't see a textbox for "just docs".

On Windows, Tomcat needs to have the `<EWS_HOME>\bin` directory added to the `PATH` env var of the user under which the service runs (SYSTEM by default).
Without that, JVM fails to find the `libtcnative-1.dll` and resorts to default JSSE connector for SSL. Through this connector, JVM then fails to find the `.keystore` file under the default location, which is current user's home, which is `C:\` for the SYSTEM user. Due to that, SSL connector does not work.

This requirement will be removed in future Enterprise Web Server release.


Comment 13 Ondřej Žižka 2011-07-19 19:56:09 UTC
This needs to be documented, pls reassign as needed.

Comment 14 Rebecca Newton 2011-07-21 00:52:30 UTC
Hey Ondrej, I think this might be covered with step 7 of procedure 4.4 here: http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Web_Server/1.0/html/Installation_Guide/sec-Configuring_the_Environment-Win.html


Comment 15 Ondřej Žižka 2011-07-21 09:32:17 UTC
Oh really, good catch!  I overlooked it. Maybe it could be "important" or something, I mean, in a box with [!]... but then we could put almost everything into box :)  So let it be, sorry for false alarm.

Comment 16 Jiri Skrabal 2012-11-13 15:56:37 UTC
Release Notes Docs Status: Removed: Not Yet Documented 
Release Notes Text: Removed: **This should go to docs, not Release Notes.** I just don't see a textbox for "just docs".

On Windows, Tomcat needs to have the `<EWS_HOME>\bin` directory added to the `PATH` env var of the user under which the service runs (SYSTEM by default).
Without that, JVM fails to find the `libtcnative-1.dll` and resorts to default JSSE connector for SSL. Through this connector, JVM then fails to find the `.keystore` file under the default location, which is current user's home, which is `C:\` for the SYSTEM user. Due to that, SSL connector does not work.

This requirement will be removed in future Enterprise Web Server release. 
Docs QE Status: Removed: NEW 



Note You need to log in before you can comment on or make changes to this bug.