首页 > 解决方案 > 在 CentOS 7 中 SSL 连接到 Apache 服务器端口 443

问题描述

我正在尝试在 CentOS 上设置 Apache 服务器。按照本文的步骤“创建虚拟主机”。在这里,我将“80”替换为“443”:

<VirtualHost *:443>

请注意,我没有firewalld按照那篇文章进行配置。

/etc/httpd/conf/httpd.conf文件中,我还将Listen 80行更改为Listen 443.

我用以下方式启动服务器:

sudo systemctl start httpd

我检查部署

wget https://my_dns

我收到此错误:

Resolving my_dns (my_dns)... xx.xxx.xx.xxx
Connecting to my_dns (my_dns)|xx.xxx.xx.xxx|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.

如果我尝试(测试端口 80)

wget my_dns

我明白Connection refused了,这是有道理的。

所以,服务器似乎在端口 443 上。但是这个 SSL 问题是什么,我该如何解决呢?

标签: apachesslcentos7

解决方案


侦听端口 443 并不意味着您正在使用 SSL。您可以在您指定的任何端口上侦听 HTTP 请求。这行得通吗?

wget http://my_dns:443

推荐阅读