centos6.5的apache上配置ssl但是仍然无法以https...访问

申请了腾讯云的免费ssl:TrustAsia DV SSL CA - G5,然后下载了证书的相关文件,一共是三个:1_root_bundle.crt,2_www.domain.com.crt 和私钥文件 3_www.domain.com.key,
然后我按照网上搜的各种博客,已经完整的配置在了apache中,etc/httpd/conf.d/ssl.conf里面的相关设置都配置好了,然后外网访问https就是访问不了,
这个是用chrome访问的错误信息:

此网站无法提供安全连接
www.example.com 发送的响应无效。
尝试运行 Windows 网络诊断。
ERR_SSL_PROTOCOL_ERROR

然后我在自己的服务器上wget https...也是连不上,错误信息如下:

--2017-02-13 10:24:04--  https://www.example.com/
Resolving www.example... 119.********
Connecting to www.example.com|119.********|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.

然后我又查看了apache的错误日志,发现ssl没有错误信息,有的只是apache本身的错误信息:

 [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
 [notice] caught SIGTERM, shutting down
 [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
 [notice] Digest: generating secret for digest authentication ...
 [notice] Digest: done
 [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
 [error] [client 59.172.151.203] File does not exist: /var/www/html/favicon.ico
 [error] [client 180.153.214.200] File does not exist: /var/www/html/1.html
 [notice] caught SIGTERM, shutting down
 [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
 [notice] Digest: generating secret for digest authentication ...
 [notice] Digest: done
 [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
 [notice] caught SIGTERM, shutting down
 [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
 [notice] Digest: generating secret for digest authentication ...
 [notice] Digest: done
 [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
 [notice] caught SIGTERM, shutting down
 [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
 [notice] Digest: generating secret for digest authentication ...
 [notice] Digest: done

然后我再curl命令在服务器上https自己得到以下错误信息:

curl: (35) SSL connect error

而且我在外网这样访问也是可以打开的http://www.example.com:443

以下是我参考并且根据自己的实际环境而设置的文章:
https://www.qcloud.com/docume...
http://www.cnblogs.com/liaoji...
还有很多很多关于配置conf的文章,
求大佬帮我看下,,是在是解决不了了。

补充一下,我查端口的占用情况,发现80端口和443端口都被httpd占用了,但是我在ssl.conf文件中明明写的是443用https啊,,可能这是问题的关键,但是我并不知道如何解决。。

阅读 11.5k
3 个回答

我也是阿里云,CentOS 7 + lnmp
centos 是自带 openssl 所以也不需要安装。
阿里云有个免费证书申请,上面有教程。下载证书然后在 nginx 的配置文件中设置监听443端口。
其中一台服务器在 nginx 设置了 listen 433 和 ssl on 之后就可以使用 https 访问了(站点:https://feizhaojun.com)
但是另一台死活弄不好。
1、netstat 查看433也是监听状态。
2、firewalld 是关闭的。
3、iptables 关闭了也不行
4、阿里云安全组也开放了443端口。
不知道怎么弄了

update

我发现一个无法访问的原因是:
我的另一个虚拟主机配置 xxx.conf 也监听了443端口,但是没有使用 ssl on;
所以出现了端口冲突。
已解决。

我用的阿里云的,刚配成功。一开始也是在乱报错,搜问题的时候看到你这^_^
先别慌着花时间求助别人,自己多想下,安装open_ssl之后需要配置ssl.conf,相信腾讯云那边有相关介绍
80端口在httpd.conf配置的,443端口在ssl.conf配置的,我试了下在httpd.conf添加443,restart httpd会报错,显示冲突,所以没什么奇怪
个人认为你可能是ssl.conf配置可能除了问题,加油~

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题