使用 openssl 配置 Tomcat 失败

使用 openssl 配置 Tomcat 失败

我正在尝试使用 openssl (ssl ) 配置 Tomcat。我已生成名为 serverde**.jks 的密钥库

我的 server.xml 配置是:

      <Connector  port="8443" protocol="HTTP/1.1"
                       maxThreads="150" scheme="https" 
               keystoreFile="/samba/restricted/apache-tomcat-8.5.37/serverdestkey.jks" 
               keyAlias="tomcat1" keystorePass="*****" clientAuth="false"
                sslProtocol="TLS"  SSLEnabled="true" />

我将相同的证书用于特定应用程序的 apache2 服务器,运行良好。但是当我尝试使用 keystore 配置与 tomcat 相同的证书时,却无法正常工作。tomcat 运行正常,但是当我尝试使用 url 页面未找到时,出现了错误。

即使我无法使用普通连接器(非 SSL -> http)访问 URL

<Connector port="8085" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

我的日志

    07-Feb-2019 12:47:58.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.37
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 12 2018 12:07:02 UTC
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.37.0
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.4.0-142-generic
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/jdk1.7.0_80/jre
    07-Feb-2019 12:47:58.613 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.7.0_80-b15
    07-Feb-2019 12:47:58.614 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
    07-Feb-2019 12:47:58.614 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /samba/restricted/apache-tomcat-8.5.37
    07-Feb-2019 12:47:58.614 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /samba/restricted/apache-tomcat-8.5.37
07-Feb-2019 12:47:58.775 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8085"]
07-Feb-2019 12:47:58.787 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
07-Feb-2019 12:47:58.817 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 808 ms
07-Feb-2019 12:47:58.848 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
07-Feb-2019 12:47:58.857 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.37
07-Feb-2019 12:47:58.874 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/docs]
07-Feb-2019 12:47:59.450 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/docs] has finished in [575] ms
07-Feb-2019 12:47:59.450 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/ROOT]
07-Feb-2019 12:47:59.488 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/ROOT] has finished in [38] ms
07-Feb-2019 12:47:59.488 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/manager]
07-Feb-2019 12:47:59.533 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/manager] has finished in [45] ms
07-Feb-2019 12:47:59.533 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/host-manager]
07-Feb-2019 12:47:59.563 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/host-manager] has finished in [30] ms
07-Feb-2019 12:47:59.563 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/examples]
07-Feb-2019 12:48:00.011 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/samba/restricted/apache-tomcat-8.5.37/webapps/examples] has finished in [447] ms
07-Feb-2019 12:48:00.026 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8085"]
07-Feb-2019 12:48:00.035 INFO [main] 

org.apache.catalina.startup.Catalina.start Server startup in 1217 ms

相关内容