首页/网络/协议速查/openssl 命令速查

openssl 命令速查

一个工具覆盖证书、密钥、摘要、加解密、协议测试:把高频命令背下来,排 TLS 问题基本不用搜索引擎。

协议速查网络更新于 2026-10-12

证书与密钥

证书与密钥
openssl x509 -in cert.pem -noout -text -dates -subject
openssl req -new -newkey rsa:2048 -nodes -keyout k.pem -out c.csr -subj "/CN=example.com"
openssl rsa -in k.pem -check
openssl pkcs12 -export -in cert.pem -inkey k.pem -out bundle.p12

协议与连接

协议与连接
openssl s_client -connect h:443 -servername h -showcerts -status </dev/null
openssl s_client -connect h:443 -tls1_3 -brief </dev/null
openssl ciphers -v 'ECDHE+AESGCM:CHACHA20'

摘要与随机

摘要与随机
openssl dgst -sha256 file
openssl rand -hex 16
openssl speed -evp aes-128-gcm

易错点

  • openssl 1.1.1 与 3.x 参数有差异(如 ciphersuites 只影响 1.3):报 unknown option 先查版本

数据来源与参考

  • OpenSSL 官方文档

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌