SSL certificate on port 443 on tomcat server for https access

I am using tomcat 9 server ,I'm trying to run as https on port 443 by a SSL certificate with .pfx format but I'm not successful in doing that.Here is the below code for server.xml

<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true">
    <SSLHostConfig>
        <Certificate certificateKeystoreFile="conf/name.pfx"
                     type="RSA" />
    </SSLHostConfig>
</Connector>

I tried using 8443 but not working However as http its working on 80/8080 by using the below code

<Connector port="80" protocol="HTTP/1.1"
           connectionTimeout="20000" 
           redirectPort="8443" useIPVHosts="true" />

So for now http://localhost is working but I need the server to run on https with SSL like https://localhost

Upvotes: 0

Views: 1785

Answers (1)

Yuri Oliveira
Yuri Oliveira

Reputation: 44

Try this:

<Connector port="443" maxHttpHeaderSize="8192" maxThreads="100"
           minSpareThreads="25" maxSpareThreads="75"
           enableLookups="false" disableUploadTimeout="true"
           acceptCount="100" scheme="https" secure="true"
           SSLEnabled="true" clientAuth="false"
           sslProtocol="TLS"
           keystoreFile="conf/name.pfx"
           keystorePass="YOUR-KEY-PASS" keystoreType="RSA"/>

if don't work with RSA, try it: PKCS12

Upvotes: 1

Related Questions