【发布时间】:2015-05-05 21:47:49
【问题描述】:
我有一个新购买的 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=参见 www.geotrust.com/resources/cps (c)15/OU=域控制验证 - QuickSSL(R)/CN=sub。域名.com 0 深度查找时出现错误 20:无法获取本地颁发者证书
我想在不同的子域中使用此证书和类似的 GeoTrust 证书在 restful web url 上进行双向 SSL 身份验证,但证书不会使用“openssl verify”对与他们一起发布的 CA 文件进行验证.任何建议都非常感谢。
【问题讨论】:
-
您的 openssl CA 商店中是否有 GeoTrust 中间证书?
-
我有 sub.domain.crt 文件和第二个文件 sub.domain.com-geotrust.crt。第二个文件包含两个 pem 格式的证书。第一个是中间体。第二个是根证书。我刚刚尝试将两个证书拆分为两个单独的文件并使用 -untrust 参数作为中间文件,但仍然收到以下错误:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA error 2 at 2 depth lookup:无法获得颁发者证书
-
如果我使用 -CAfile 将 CA 文件作为参数传递给 openssl,该文件包含我的证书的中间 CA 和根 CA,是否还需要将中间 CA 和根 CA 添加到“存储”位置使用 openssl 版本 -d 找到?我的看法是没有,但我也会尝试的。谢谢。
-
只是为了排除显而易见的问题 - 根 CA 是自签名的吗?我不确定 GeoTrust,但许多 CA 供应商倾向于使用多层中间体,因此最好确保第二个证书绝对是根证书。您是否尝试在拆分证书后向 openssl 提供
CAdir参数? -
您的 CA 目录中是否有 GeoTrust 根 CA?如果证书的问题和主题不同,则根据定义,它不是根 CA。我刚刚去了我的 Firefox 证书存储,找到了名为
GeoTrust Global CA的根 CA,并为您提取了它:filedropper.com/geotrustglobalca。尝试将其重命名为 CADir 中的 .pem 文件,看看是否验证成功。