Docker容器中运行的Apache Webserver SSL证书无法正常工作
Apache Docker容器HTTPS访问异常
- 使用
httpd:2.4.41镜像创建了Apache Web服务器容器 - 通过以下openssl命令在主机生成SSL私钥和证书:
openssl req -newkey rsa:2048 -nodes -keyout /mnt/hgfs/services/apachebinaries/server/conf/ssl/server.key -x509 -out /mnt/hgfs/services/apachebinaries/server/conf/ssl/certificate.crt
- 在容器的
httpd.conf中配置HTTPS虚拟主机:
<VirtualHost *:443> SSLEngine on SSLCertificateFile /usr/local/apache2/conf/ssl/certificate.crt SSLCertificateKeyFile /usr/local/apache2/conf/ssl/server.key # 其他配置项 </VirtualHost>
- 已确认主机到容器的路径挂载正确,且docker-compose中已完成容器443端口到主机的发布
问题:通过主机IP访问对应端口时,浏览器提示SSL协议错误(ERR_SSL_PROTOCOL_ERROR)
内容的提问来源于stack exchange,提问作者Timo
相关产品推荐
相关产品推荐

