OpenSSL

    Generate self-signed certificate

    openssl genrsa -aes256 -out server.key 4096

    openssl rsa -in server.key -out server.key

    openssl req -new -key server.key -out server.csr

    Example :

    Country Name (2 letter code) [AU]:FR
    State or Province Name (full name) [Some-State]:Alsace
    Locality Name (eg, city) []:Colmar
    Organization Name (eg, company) [Internet Widgits Pty Ltd]:Parmentier
    Organizational Unit Name (eg, section) []:
    Common Name (e.g. server FQDN or YOUR name) []:subdomain.parmentier.io
    Email Address []:support@society-lbl.com
    
    Please enter the following 'extra' attributes
    to be sent with your certificate request
    A challenge password []:
    An optional company name []:
    

    openssl x509 -req -days 1095 -in server.csr -signkey server.key -out server.crt

    Cert infos

    openssl x509 -noout -text -in server.crt
    

    Fingerprint

    openssl x509 -in server.crt -noout -fingerprint -sha256
    

    SSL Client

    openssl s_client -connect imap.gmail.com:993
    

    Show certificate

    openssl s_client -connect ${SERVER}:${PORT} -showcerts </dev/null 2>/dev/null | sed -e '/-----BEGIN/,/-----END/!d' | tee "domain.crt" >/dev/null