OpenSSL
加密與 SSL/TLS 工具套件
加密解密
AES-256-CBC 加密
openssl aes-256-cbc -in 123.txt -out encrypted_123AES-256-CBC 解密
openssl aes-256-cbc -d -in encrypted_123 -out abc.txt憑證操作
產生私鑰
openssl genrsa -out private.key 2048產生 CSR
openssl req -new -key private.key -out certificate.csr產生自簽憑證
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate.crt查看憑證資訊
openssl x509 -in certificate.crt -text -noout驗證憑證與私鑰匹配
openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa -noout -modulus -in private.key | openssl md5雜湊與校驗
MD5
openssl md5 filenameSHA256
openssl sha256 filename連線測試
測試 SSL/TLS 連線
openssl s_client -connect example.com:443查看伺服器憑證
openssl s_client -connect example.com:443 -showcerts