0

I am trying to configure Tomcat with openssl (ssl ). I have generated Keystore by name serverde**.jks

My config With server.xml Is:

      <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" />

I used same certificate for apache2 server with specific application, which works fine. But when I try to config same certificate with tomcat using keystore fail to work. tomcat is running successfully but, when i tried access with url page not found error occurs.

Even I cannot access url with normal connector(non-ssl -> http)

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

MY log

    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
  • Did you add also the key (not only certificate)? – Romeo Ninov Feb 7 at 7:47
  • Yeah I have added.. – selvakumar Feb 7 at 8:16
  • have you try to access the site with openssl command? – Romeo Ninov Feb 7 at 8:21
  • No how to access.. Im new to this – selvakumar Feb 7 at 8:34
  • 1
    Solved .. firewall issue forget to allow ufw --> ufw allow 8443 – selvakumar Feb 7 at 12:04

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.