2

I have configured tomcat inside docker container as follows

 <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                   maxThreads="150" SSLEnabled="true">
            <SSLHostConfig>
                <Certificate certificateKeystoreFile="my.jks"
                             type="RSA" />
            </SSLHostConfig>
        </Connector>

        <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
                   maxThreads="150" SSLEnabled="true" >
            <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
            <SSLHostConfig>
                    <Certificate certificateKeyFile="/etc/letsencrypt/live/example.com/privkey.pem"
                            certificateFile="/etc/letsencrypt/live/example.com/cert.pem"
                            certificateChainFile="/etc/letsencrypt/live/example.com/chain.pem"
                             type="RSA" />

Restarted the docker container but its not accessible via https

where my.jks is stored inside tomcat/conf directory.

I configure docker container as follows:

docker run -d \
    --name=nameofcontainer \
    -p 80:8080 \
    -p 443:8443 \
    --net=cyclos-net \
    --cap-add=NET_ADMIN \
    -e DB_HOST=cyclos-db \
    -e DB_NAME=cyclos \
    -e DB_USER=cyclos \
    -e DB_PASSWORD=cyclos \
    image-id

But website is not accessible via https or port 8443

1

As per SSL/TLS Configuration HOW-TO:

To define a Java (JSSE) connector, regardless of whether the APR library is loaded or not, use ONE of the following:

<!-- Define a HTTP/1.1 Connector on port 8443, JSSE NIO implementation -->
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="8443" .../>

<!-- Define a HTTP/1.1 Connector on port 8443, JSSE BIO implementation -->
<Connector protocol="org.apache.coyote.http11.Http11Protocol" port="8443" .../>

Why do you use both connectors together on the same port?

You should use one of them only. Or configure them on the different ports.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.