zoukankan      html  css  js  c++  java
  • curl检测https证书有效期命令

    curl检测https证书有效期命令

    curl -vvI https://域名

    例如:

    [root@st-01 cert]# curl -vvI https://www.baidu.com
    * About to connect() to www.baidu.com port 443 (#0)
    *   Trying 110.242.68.4...
    * Connected to www.baidu.com (110.242.68.4) port 443 (#0)
    * Initializing NSS with certpath: sql:/etc/pki/nssdb
    *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
      CApath: none
    * SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
    * Server certificate:
    * 	subject: CN=baidu.com,O="Beijing Baidu Netcom Science Technology Co., Ltd",OU=service operation department,L=beijing,ST=beijing,C=CN
    * 	start date: Jul 01 01:16:03 2021 GMT
    * 	expire date: Aug 02 01:16:03 2022 GMT
    * 	common name: baidu.com
    * 	issuer: CN=GlobalSign Organization Validation CA - SHA256 - G2,O=GlobalSign nv-sa,C=BE
    > HEAD / HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: www.baidu.com
    > Accept: */*
    > 
    < HTTP/1.1 200 OK
    HTTP/1.1 200 OK
    < Accept-Ranges: bytes
    Accept-Ranges: bytes
    < Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
    Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
    < Connection: keep-alive
    Connection: keep-alive
    < Content-Length: 277
    Content-Length: 277
    < Content-Type: text/html
    Content-Type: text/html
    < Date: Fri, 10 Dec 2021 05:00:22 GMT
    Date: Fri, 10 Dec 2021 05:00:22 GMT
    < Etag: "575e1f59-115"
    Etag: "575e1f59-115"
    < Last-Modified: Mon, 13 Jun 2016 02:50:01 GMT
    Last-Modified: Mon, 13 Jun 2016 02:50:01 GMT
    < Pragma: no-cache
    Pragma: no-cache
    < Server: bfe/1.0.8.18
    Server: bfe/1.0.8.18
    
    < 
    * Connection #0 to host www.baidu.com left intact
    

      

    这样就可以 使用curl的命令直接查看证书信息了

  • 相关阅读:
    Android -- 保存文件
    Android -- AsyncTask
    Java 集合
    Android -- ViewPager放入多个XML监听每个的控件
    Android -- 自定义标题栏,背景颜色填充满
    PowerShell正则表达式(一) 定义模式
    PowerShell 简单模式识别 1
    Powershell 设置数值格式 1
    PowerShell String对象方法 1
    PowerShell 字符串操作符
  • 原文地址:https://www.cnblogs.com/xzlive/p/15671233.html
Copyright © 2011-2022 走看看