大网数据广告活动
服务器运维问答

Cyclos Docker SSL Impelementation for tomcat

· 52CE 我爱测

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…

问题原文

原帖链接 · Muhammad Muazzam · CC BY-SA 4.0

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

已采纳解答

原帖链接 · Sergey Nudnov · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-05-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。