Tomcat上的SSL认证

时间:2018-10-28 19:54:08

标签: java tomcat ssl firefox openssl

我在GCE的Debian虚拟机上运行了一个Java Web应用程序。 我不确定这是否相关(我不认为是为了以防万一)-我在此系统中使用Vaadin 8,因此对它的任何HTTP调用都由Vaadin servlet处理。

对于SSL认证,我在self-signed SSL certificate on GCE -- 'SSL certificate could not be parsed'中运行了openssl命令以获取CA授权并自己生成SSL认证。因此,通过此操作,我首先要成为认证机构来认证我的SSL。

self-signed SSL certificate on GCE -- 'SSL certificate could not be parsed'中的命令之后,我按照https://tomcat.apache.org/tomcat-8.5-doc/ssl-howto.html中的说明进行了以下操作:

运行以下两个命令而没有错误:

keytool -genkey -alias myalias -keyalg RSA
openssl pkcs12 -export -in mySite.com.pem -inkey mySite.com.key -out mycert.p12 -name myalias -CAfile msite.CA.pem -caname root -chain

第二个命令在目录中生成mycert.p12

然后我配置了server.xml。以下是configuration中现在存在的所有server.xml标签。

<Service name="Catalina">
<Connector
       protocol="org.apache.coyote.http11.Http11NioProtocol"
       port="8443" maxThreads="200"
       scheme="https" secure="true" SSLEnabled="true"
       keystoreFile="/root/.keystore" keystorePass="myPasswd"
       clientAuth="false" sslProtocol="TLS"/>
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector port="443" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> 
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
…
</Service>

将其替换为Tomcat server.xml目录中的conf。重新启动Tomcat。在Firefox中调用了我的应用程序-仍然看到SSL警告:

enter image description here

据我所知,这没有用,因为

  1. 我在Tomcat上的证书配置中缺少某些内容-不确定我是否正确执行了server.xml。我没有在Tomcat上的其他地方做任何事情。
  2. 我拥有所有配置权,但是Firefox不接受由未知授权机构签名的SSL。

我不确定(2)是否可以。我读过的博客告诉我们,生成.pem文件会将其连接到公开的CA-s,应该可以((?)

任何帮助将不胜感激。这已经浪费了我好几天的时间-我对SSL或任何安全性问题都不了解-甚至不知道从这里去哪里!

注意:见Installing SSL certificate on JBoss和其他一些有用的讨论。

// ----------------

编辑:

请注意;我发现catalina.out上没有错误。

// ----------------

EDIT-2:

我在Firefox中通过http:// ..致电时收到上面的安全警告(屏幕截图)。呼叫https://..出现以下错误:

enter image description here

0 个答案:

没有答案