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的命令直接查看证书信息了

  • 相关阅读:
    10、函数介绍、函数参数、函数的返回值
    9、bytes类型,文件处理
    8、集合类型、文件处理
    7、列表类型、元组、字典类型
    6、for循环补充、可变类型与不可变类型、基本操作
    5、while循环与for循环
    4、基本运算符、if语法
    3、变量、常量、基本数据类型
    爬虫(一)
    小技能(二)
  • 原文地址:https://www.cnblogs.com/xzlive/p/15671233.html
Copyright © 2011-2022 走看看