You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 01:35:02