大网数据广告活动
服务器运维问答

Openssl: Extract root certificate from certificate chain?

· 52CE 我爱测

I am fetching a certificate chain with openssl s_client -showcerts -connect host.whatever:443 </dev/null . In addition to that I would like to extract the root certificate form the chain programmatically in the format -----BEGIN …

问题原文

原帖链接 · Mike Stan · CC BY-SA 3.0

I am fetching a certificate chain with openssl s_client -showcerts -connect host.whatever:443 </dev/null.

In addition to that I would like to extract the root certificate form the chain programmatically in the format -----BEGIN CERTIFICATE-----.....-----END CERTIFICATE-----

Does anybody know of a functionality that is capable of that and already ships with OpenSSL?

已采纳解答

原帖链接 · Steffen Ullrich · CC BY-SA 3.0

openssl s_client shows you only the certificate chain send by the client. This chain usually does not include the root certificate itself. Instead the root certificate is only contained in the local trust store and is not send by the server. As far as I know there is no builtin way to get the root certificate for a connection using the openssl command line.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-09-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。