运行“openssl s_client -showcerts”时出现套接字错误

运行“openssl s_client -showcerts”时出现套接字错误

我有一个 .PEM 文件,想安装在 Tomcat 服务器上。该文件如下所示:

friendlyName: 
subject=CN=myserver.ca.example.com, OU=servers, O=Example, C=US
issuer=CN=Example Basic Assurance Software Issuing CA G3, OU=certservers, O=Example, C=US
-----BEGIN CERTIFICATE-----
xxxxxxxx
-----END CERTIFICATE-----

subject=CN=Example Basic Assurance Software Issuing CA G3, OU=certservers, O=Example, C=US
issuer=CN=Example Basic Assurance Software Root CA G2, OU=certservers, O=Example, C=US
-----BEGIN CERTIFICATE-----
xxxxxxxx
-----END CERTIFICATE-----

subject=CN=Example Basic Assurance Software Root CA G2, OU=certservers, O=Example, C=US
issuer=CN=Example Basic Assurance Software Root CA G2, OU=certservers, O=Example, C=US
-----BEGIN CERTIFICATE-----
xxxxxxxx
-----END CERTIFICATE-----

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E2EC8A310F02CA01

xxxxxxxx
-----END RSA PRIVATE KEY-----

当我运行命令“openssl s_client -showcerts -cert myserver.pem”时,我得到了这个:

Enter pass phrase for myserver.pem:
socket: Bad file descriptor
connect:errno=9

我不确定为什么我只想显示文件中的证书时会出现这种情况。我尝试了各种选项,例如 -prexit,但没有看到任何有用的信息。我是否需要提取根证书并将其安装在某处?如果需要,在哪里?或者我的问题完全不同?

相关内容