首页  >  问答  >  正文

linux - 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啊,,可能这是问题的关键,但是我并不知道如何解决。。

PHP中文网PHP中文网2744 天前1013

全部回复(1)我来回复

  • PHP中文网

    PHP中文网2017-04-17 16:43:57

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

    回复
    0
  • 取消回复