ssl - openssl 验证不使用 GeoTrust 证书

标签 ssl https openssl

我有一个新购买的 GeoTrust 域证书和一个匹配的 CA 文件,想用 openssl 进行验证。

openssl verify -verbose -purpose any 
-CAfile /full/path/sub.domain.com-geotrust.crt  /full/path/sub.domain.com.crt

从这个页面:https://secure.marumoto.us/motowiki/tiki-index.php?page=Verify+a+Certificate+Chain

链中每个证书的颁发者应与链中下一个证书的主题相匹配。例如,myserver.mydomain.com.cert 的颁发者应与 myintermediate_ca.cert 的主题相匹配,而 myintermediate_ca.cert 的颁发者应与 myroot_ca.cert 的主题相匹配。您可以使用以下命令查看 .pem 或 base64 格式的证书。

来自

openssl x509 -text -in sub.domain.crt and
openssl x509 -text -in sub.domain-geotrust.crt (CA root file)

sub.domain.com
Subject:    OU=GT44865949, 
            OU=See www.geotrust.com/resources/cps (c)15, 
            OU=Domain Control Validated - QuickSSL(R), 
            CN=sub.domain.com
Issuer:
            commonName                = GeoTrust DV SSL CA - G4
            organizationalUnitName    = Domain Validated SSL
            organizationName          = GeoTrust Inc.
            countryName               = US        

Intermediate:        
Subject:
            commonName                = GeoTrust DV SSL CA - G4
            organizationalUnitName    = Domain Validated SSL
            organizationName          = GeoTrust Inc.
            countryName               = US

Issuer:
            commonName                = GeoTrust Global CA
            organizationName          = GeoTrust Inc.
            countryName               = US

Root:
Subject:
            commonName                = GeoTrust Global CA
            organizationName          = GeoTrust Inc.
            countryName               = US
Issuer:
            organizationalUnitName    = Equifax Secure Certificate Authority
            organizationName          = Equifax
            countryName               = US            

看来我的 Issuer 和 Subject 字段匹配正确,但我在使用 openssl 时遇到以下错误:

0 深度查找时出现错误 20:无法获取本地颁发者证书 /full/path/sub.domain.com.crt:/OU=GT44865949/OU=See www.geotrust.com/resources/cps (c)15/OU=域控制验证 - QuickSSL(R)/CN=sub。域名.com 0 深度查找时出现错误 20:无法获取本地颁发者证书

我想在不同的子域中使用此证书和类似的 GeoTrust 证书在 restful web url 上进行双向 SSL 身份验证,但证书不会使用“openssl 验证”来验证与它们一起发布的 CA 文件.非常感谢任何建议。

最佳答案

根据讨论,这是允许 openssl 查看整个验证链的问题:包括 GeoTrust CA 中间体和根。

openssl 应该使用包含 PEM 格式的所有 3 个 CA 的 CADir 参数运行。 GeoTrust 的实际根目录可以从您最喜欢的浏览器中提取,也可以在此处提取:filedropper.com/geotrustglobalca。

当您配置您的实际服务器时,只需确保您在 Server Hello 上发送中间体,有些站点不会这样做并破坏没有缓存中间体的客户端。

关于ssl - openssl 验证不使用 GeoTrust 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28862365/

相关文章:

c - 在 C 中使用带有 RSA 的 SHA1 对数据数组进行签名

javax.net.ssl.SSLHandshakeException :Remote host closed connection during handshake

php - SSL自签名认证,用PHP连接Mysql

c# - 使用 WebRequest 和 WebResponse 登录 Https 网站不起作用 C#

wcf - https 带有 WCF 错误 : "Could not find base address that matches scheme https"

c - 从 X509 结构打开 SSL 提取证书到 char 数组

ssl - 尝试将 Paypal 证书更改集成到 GoDaddy 共享托管环境中时出现问题

apache - apache2 中的密码文件是什么?

ssl - 使用 Erlang 进行 https 发布的简单示例

ruby 和 "You must recompile Ruby with OpenSSL support or change the sources in your Gemfile"