我该怎么做才能知道 SSL 是否正常工作?

我该怎么做才能知道 SSL 是否正常工作?

我正在使用 NGINX,我刚刚设置了一个域和子域,两者都需要有 SSL。

查看子域名的服务器块

server {

   listen 80;
   listen 443 ssl;
   server_name www.desktop.just4bettors.mobi  desktop.just4bettors.mobi;
   root   /home/c0pt/capilleira/capilleiraclickandgambleweb/dist;

   ssl_certificate      /etc/ssl/certs/just4bettors.mobi.chained.crt;
   ssl_certificate_key  /etc/ssl/private/just4bettors.mobi.key;

   ssl_session_cache    shared:SSL:1m;
   ssl_session_timeout  5m;

   ssl_ciphers  HIGH:!aNULL:!MD5;
   ssl_prefer_server_ciphers  on;

   location / {
        index index.html index.htm;
        ...
   }

}

如果我进入该子域名,一切都会正常工作,但是,我如何知道 SSL 是否已设置?

答案1

您可以运行以下测试:

  1. telnet $server_ip 443

    这将告诉您是否有东西在监听该端口

    telnet desktop.just4bettors.mobi 443
    Trying xxx.xxx.xx.xxx...
    Connected to desktop.just4bettors.mobi.
    Escape character is '^]'.
    ^]
    telnet> q
    Connection closed.
    
  2. openssl s_client -connect $server_ip:443 -showcerts

    openssl这实际上将查询服务并检索证书,您也应该能够使用检查信任链。

    openssl s_client -connect desktop.just4bettors.mobi:443
    CONNECTED(00000003)
    depth=3 C = US, O = "The Go Daddy Group, Inc.", OU = Go Daddy Class 2 Certification Authority
    verify return:1
    depth=2 C = US, ST = Arizona, L = Scottsdale, O = "GoDaddy.com, Inc.", CN = Go Daddy Root Certificate Authority - G2
    verify return:1
    depth=1 C = US, ST = Arizona, L = Scottsdale, O = "GoDaddy.com, Inc.", OU = http://certs.godaddy.com/repository/, CN = Go Daddy Secure Certificate Authority - G2
    verify return:1
    depth=0 OU = Domain Control Validated, CN = *.just4bettors.mobi
    verify return:1
    ---
    Certificate chain
     0 s:/OU=Domain Control Validated/CN=*.just4bettors.mobi
       i:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2
     1 s:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2
       i:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root  Certificate Authority - G2
     2 s:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2
       i:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority
     3 s:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority
       i:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority
    ---
    Server certificate
    -----BEGIN CERTIFICATE-----
    xxxxx
    
  3. 使用第三方服务,例如SSL 实验室

答案2

您可以将域名转让给https://www.ssllabs.com/ssltest/它将测试你的 sll 并发回详细结果。如下所示:

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

相关内容