V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
orangutan92
V2EX  ›  Linux

CloudFlare 的免费 15 年的 SSL 证书配置成功,依旧无法访问网站怎么解决?

  •  
  •   orangutan92 · 2018-06-15 17:56:45 +08:00 · 9964 次点击
    这是一个创建于 2113 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前用过那个 let 啥开头的 90 天免费 SSL,这个配置了好久还是不能用。 后来我看了简书教程,和上面的操作一样,结果访问首页报错 Error 525,经过 SSL 测试网站发现证书是 OK 的,这个问题怎么解决呢? 虚拟主机关键配置如下,系统是 centos6:

        listen 80;
        listen 443 ssl; 
        ssl                on;
        ssl_certificate         /data/https/domain.pem;
        ssl_certificate_key     /data/https/domain.key;
    
    25 条回复    2019-07-08 10:47:03 +08:00
    artandlol
        1
    artandlol  
       2018-06-15 18:06:47 +08:00 via iPhone
    阿里云就有免费的 ssl 证书,前几天刚配了一个
    asuraa
        2
    asuraa  
       2018-06-15 18:09:10 +08:00
    input2output
        3
    input2output  
       2018-06-15 18:10:17 +08:00
    certbot
    momocraft
        4
    momocraft  
       2018-06-15 18:11:19 +08:00
    这个错误叫 handshake failed,你只贴个证书文件的路径很难看出什么
    ThirdFlame
        5
    ThirdFlame  
       2018-06-15 18:21:21 +08:00
    和 let's encrypt 、CloudFlare 的证书没有多大关系,还是 NGINX 配置问题。
    我用 acme.sh 按照教程配置的,没问题好用,自动续期 let's encrypt 的证书。
    cnyang
        6
    cnyang  
       2018-06-15 18:38:37 +08:00
    把中间证书加进文件试下
    Showfom
        7
    Showfom  
       2018-06-15 19:30:00 +08:00
    这个证书本来就是自己签发的 浏览器不认的
    Servo
        8
    Servo  
       2018-06-15 19:41:10 +08:00
    楼主真可爱。
    orangutan92
        9
    orangutan92  
    OP
       2018-06-15 19:50:17 +08:00
    @input2output 这个用了,还要装 Python3,默认用的 2,装完后软链接到 Python3 后 yum 不能用,又要改配置文件,把 yum 更新后用这个工具的命令,一键安装完成后依旧是网站打不开的。
    onionnews
        10
    onionnews  
       2018-06-15 19:52:00 +08:00 via Android
    这个证书要配合 CF 的 CDN 才能正常工作
    laoyur
        11
    laoyur  
       2018-06-15 19:58:14 +08:00
    你这个 525 我似乎也碰到过,是 CF 跟国内服务器 ssl 握手不成功,简单说是被墙了
    似乎看有大佬说过,是因为 SNI 被墙,不知道禁用 SNI 是不是就能绕过?
    orangutan92
        12
    orangutan92  
    OP
       2018-06-15 20:01:26 +08:00
    @laoyur 我用的搬瓦工啊,和国内没关系啊
    orangutan92
        13
    orangutan92  
    OP
       2018-06-15 20:01:43 +08:00
    @onionnews 用的就是 CF 的 CDN。。。
    input2output
        14
    input2output  
       2018-06-15 20:03:52 +08:00
    把 CDN 关掉试试
    iluhcm
        15
    iluhcm  
       2018-06-15 20:11:10 +08:00
    目测中间证书的问题,把服务器证书替换成 fullchain.cer 试试。
    maxco292
        16
    maxco292  
       2018-06-15 20:59:21 +08:00
    /var/log/nginx 错误日志如何
    Droi
        17
    Droi  
       2018-06-16 08:07:03 +08:00
    有可能是 let's encrypt 证书续签时 80 端口被占用,没用续签成功。

    CloudFlare 默认是用 http 去连接网站。先确认你的 SSL 连接是 Full 或者是 Full(strick)。
    再确认 Crypto 中的 Universal SSL Status 已经是 Active Certificate, 也就是在 Crypto 页面最下面的 Enable Universal SSL 是开启的。
    这些做好后等 24 小时就可以用 CDN 自签发的证书,或者 let's encrypt 其他的证书。
    https://i.loli.net/2018/06/16/5b244f89cbdf0.png
    https://i.loli.net/2018/06/16/5b244f89cd56b.png
    orangutan92
        18
    orangutan92  
    OP
       2018-06-16 15:28:32 +08:00
    @Droi 和你的图片设置是一样的啊,第二个 disabled 我没点。
    Droi
        19
    Droi  
       2018-06-16 20:22:05 +08:00
    @orangutan92 先把 cdn 关掉吧。看看域名能不能直接访问,如果正常的话浏览会提示未认证的证书。只能这样分段排查了。
    orangutan92
        20
    orangutan92  
    OP
       2018-06-20 10:15:00 +08:00
    @maxco292 这个路径下没有 nginx 这个文件夹呀
    orangutan92
        21
    orangutan92  
    OP
       2018-06-20 11:22:34 +08:00
    @maxco292 报错是这样的
    ![]( )
    orangutan92
        22
    orangutan92  
    OP
       2018-06-20 11:23:33 +08:00
    @momocraft 错误我已经在下面贴出来了,你看下是什么问题呢
    orangutan92
        23
    orangutan92  
    OP
       2018-06-20 11:30:05 +08:00
    解决了,还是按照官网的这个配置,不写到 nginx.conf,而是写到虚拟主机的配置文件里面。
    https://support.cloudflare.com/hc/en-us/articles/217471977
    default7
        24
    default7  
       2019-07-08 00:41:18 +08:00
    @orangutan92 如果服务器是 VPS 呢?不写入到 nginx 的配置中吗
    orangutan92
        25
    orangutan92  
    OP
       2019-07-08 10:47:03 +08:00
    @default7 就是 VPS 啊,是我虚拟主机的配置有问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5361 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:57 · PVG 16:57 · LAX 01:57 · JFK 04:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.