-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run Tomcat with SSL for EMF server #130
Comments
I did find a useful article on the that should help when get to this task. I will add a link to this in the ticket. Using SSL with Axis: https://www.informit.com/articles/article.aspx?p=24604 |
I was able to successfully set up SSL in my Tomcat installation (9.0) and connect with the EMF client. https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html#Configuration Generate a keystore file - for development, this is a self-signed certificate. On the production server, we'll need to get a real SSL certificate from an authority.
password: changeit (this is the Java default so it's not a secret) Update the Tomcat conf file server.xml. Uncomment the section
Restart Tomcat and confirm that https://localhost:8443/ loads in a browser - the browser will complain about the certificate. With a real certificate, the EMF Client should just work at this point by setting the URL to https://server:8443/emf/services. For development, the self-signed certificate needs to get added to Java's keystore. I opted to make a local copy of the default keystore to modify
Download the self-signed certificate
Add the self-signed certificate to the keystore
When running the EMF Client, add the system property javax.net.ssl.trustStore
|
Based on my testing, I think we can go ahead and get an SSL certificate for the production server - not sure how that's handled for epa.gov domains. Once we have the certificate, we can turn on SSL alongside the existing HTTP connection and confirm there are no issues. |
Successfully ran the EMF Client using port 8443 on the EPA server. Two changes are needed to the EMFClient.bat file:
Current
New
Will need to update the EMF Client Installer program which automatically writes the EMFClient.bat file |
Looking through the emf.properties table, there's a property named DOWNLOAD_EXPORT_ROOT_URL which references port 8080. Once non-SSL access is turned off, this should get updated to 'https://server:8443/exports/'. |
I tried setting the last of of bat file to this, but I could not get on: java -Xmx1024M -DUSER_PREFERENCES="%userprofile%\EMFPrefs.txt" -DEMF_HOME="%EMF_HOME%" -DR_HOME="%R_HOME%" -Djavax.net.ssl.trustStore=WINDOWS-ROOT -classpath %CLASSPATH% gov.epa.emissions.framework.client.EMFClient https://sage.hesc.epa.gov:8443/emf/services The error was: |
It looks like the Java property to set should be javax.net.ssl.trustStoreType rather than trustStore
I've attached a small Java program to help with testing the SSL connection (I needed to add the .txt extension to make GitHub happy):
By default, the program contacts google.com and prints some info about the certificate chain. Because Google uses a standard certificate issuer, nothing special needs to happen with the trustStoreType setting. The first two lines in the output (null, null) are the values of the trustStoreType and trustStore properties. If you give the trustStoreType as a command-line parameter:
You should see the first line in the output be WINDOWS-ROOT instead of null. This is a quick check to make sure the command-line parameter is correct. The connection to google.com should still work fine; the program is just using Window's certificate trust information instead of what's built into the JVM. To try connecting to the EPA EMF server, edit the Java program and change the line
to
If you run the modified program without any parameters, you should get the same "PKIX path building failed" error we've been seeing. But with -Djavax.net.ssl.trustStoreType=WINDOWS-ROOT hopefully things will work. As a test, I tried connecting to a military website that uses a custom certificate authority managed by DoD. I used the Windows program certmgr.msc to add the certificate authority to the list of Trusted Root Certification Authorities. At that point, I could load the site through a browser without any security warnings, and setting trustStoreType allowed the SSLTest program to connect. I'm hoping this is analogous to how the EPA Enterprise certificate authority has already been set up on the EPA Windows machines. |
Need to look at how to configure Tomcat to using SSL/TLS, or possibly add nginx proxy on server. Confirm that EMF Client works with HTTPS connection, including local file upload and download.
The text was updated successfully, but these errors were encountered: