Tomcat: Trouble with SSL https connection on port 8443

前端 未结 3 764
南方客
南方客 2021-02-16 00:01

We are having trouble with the https (port 8443) connection on an app that runs on Tomcat 7. The app is running fine on http (port 80) now. I have uncommented the \"Define a SSL

相关标签:
3条回答
  • 2021-02-16 00:46

    I know this is a little old, but I noticed that you forgot the protocol inside the connector. Maybe that was the problem.

    0 讨论(0)
  • 2021-02-16 00:47

    I had this issue when working with Tomcat 9.0 and Ubuntu 18.04.

    For me it was typo in my connection settings, I had to copy a working one from a server to this server, and then modified it accordingly:

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="conf/key.key"
                         certificateFile="conf/cert.crt"
                         certificateChainFile="conf/chain.crt"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    

    Note: I confirmed that the certificates were working very fine.

    That's all

    I hope this helps

    0 讨论(0)
  • 2021-02-16 00:49

    Atlast it started working... Installed new copy of server, modified server.xml as below,

    <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" 
               redirectPort="8443"/>
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    
    <Connector SSLEnabled="true" acceptCount="100" clientAuth="false" 
               disableUploadTimeout="true" enableLookups="false" 
               keystoreFile="k:/tomcat.keystore" keystorePass="*****" 
               maxThreads="25" port="8443" 
               protocol="org.apache.coyote.http11.Http11NioProtocol" 
               scheme="https" secure="true" sslProtocol="TLS"/>
    
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
    

    Used below command to generate keystore file

    keytool -genkey -alias tomcat -keyalg RSA -keystore k:/tomcat.keystore
    
    0 讨论(0)
提交回复
热议问题