Code Monkey home page Code Monkey logo

https_cert_expired_check's Introduction

https_cert_expired_check

域名证书有效期检查shell脚本和命令行工具

Shell版

  • https_cert_check_v2_openssl.sh and https_cert_check_v2_curl.sh
    # v2版可以批量处理多个域名 记录日志 并记录检查结果到csv文件
    # 用法如下 执行完会输出带时间戳的日志文件与检查结果csv文件
    bash https_cert_check_v2_openssl.sh
    bash https_cert_check_v2_curl.sh
    # curl版超时控制友好点 但是依赖curl命令;
    # openssl版一般Linux和Windows甚至Mac系统都有集成 兼容性更好

golang版

  • 用法说明

    Usage of \main.exe:           
      -c int           # 并发数 默认42                                                                           
            Maximum number of hosts to check at once. (default 42)                                
      -d int           # 查询多少天内要过期的证书 默认30                                                                           
            Warn if the certificate will expire within this many days. (default 30)               
      -h string        # 域名列表文件 用于批量查询 *必选项*                                                                           
            The path to the file containing a list of hosts to check.                             
      -m int           # 查询几个月内要过期的证书                                                                           
            Warn if the certificate will expire within this many months.                          
      -s    Verify that non-root certificates are using a good signature algorithm. (default true)     # 检查非根证书算法是否在支持列表
      -t int           # 连接超时控制 主要用于处理域名不可达情况                                                                           
            Dial connect timeout seconds (default 3)                                             
      -y int           # 查询几年内要过去的证书                                                                           
            Warn if the certificate will expire within this many years.
    
  • 示例

    # 查询当前目录下hosts.txt文件里的域名2年内到期的所有证书列表
    go run .\main.go -h .\hosts.txt -y 2
    
  • 跨平台编译

    Windows 下编译 Mac 和 Linux 64位可执行程序
    SET CGO_ENABLED=0
    SET GOOS=darwin
    SET GOARCH=amd64
    go build main.go
    SET CGO_ENABLED=0
    SET GOOS=linux
    SET GOARCH=amd64
    go build main.go
    
    Mac 下编译 Linux 和 Windows 64位可执行程序
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
    CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
    
    Linux 下编译 Mac 和 Windows 64位可执行程序
    CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go
    CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
    
    

    https_cert_expired_check

https_cert_expired_check's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.