我申请了Goddady的Apache证书,目录里面有:
我查了一下,x.crt
内容和x.pem
一样(只有一个CERTIFICATE
), >x_bundle-g2-g1.crt
里面有 3 个 CERTIFICATE
。
为什么x.crt
和x.pem
需要相同的内容?
x_bundle-g2-g1.crt
的作用是什么,里面有3个CERTIFICATE
,是否指的是x_bundle
,g2
和 g1
?
最佳答案
我猜 X.pem
是您的服务器证书,由 GoDaddy 安全证书颁发机构 - G2 颁发
然后 x_bundle-g2-g1.crt
是直到根 GoDaddy 证书的信任链。
查看x_bundle-g2-g1.crt
的内容使用 openssl 命令:
openssl crl2pkcs7 -nocrl -certfile x_bundle-g2-g1.crt | openssl pkcs7 -print_certs -text -noout | grep -E 'Subject:|Issuer:'
这个 hack 是打印 PEM 文件中的所有证书
我希望输出是这样的:
Issuer: C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2
Subject: C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2
Issuer: C=US, O=The Go Daddy Group, Inc., OU=Go Daddy Class 2 Certification Authority
Subject: C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2
Issuer: C=US, O=The Go Daddy Group, Inc., OU=Go Daddy Class 2 Certification Authority
Subject: C=US, O=The Go Daddy Group, Inc., OU=Go Daddy Class 2 Certification Authority
也就是说,
-
Go Daddy Secure Certificate Authority - G2
由Go Daddy Root Certificate Authority - G2
签署 -
Go Daddy Root Certificate Authority - G2
- 自签名
Go Daddy Class 2 Certification Authority
检查您的网络服务器向客户端提供了哪些证书:
openssl s_client -showcerts -servername YOUR_SERVER -connect YOUR_SERVER:443 </dev/null
我敢打赌它提供了完整的链 -
- 来自
X.pem
的服务器证书 - Go Daddy 安全证书颁发机构 - G2
- Go Daddy 根证书颁发机构 - G2
这是对丢失中间 GoDaddy 证书的终端系统(例如兄弟)的预防措施。
关于ssl - Apache 证书目录中的 `x_budle-g2-g1.crt` 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60982922/