完善证书解析错误提示

This commit is contained in:
yansongda 2021-07-31 19:14:23 +08:00
parent 4cb2661658
commit b5d93d8219

View File

@ -125,7 +125,13 @@ class PreparePlugin implements PluginInterface
continue;
}
$detail = $this->formatCert(openssl_x509_parse($cert.'-----END CERTIFICATE-----'));
$ssl = openssl_x509_parse($cert . '-----END CERTIFICATE-----');
if (false === $ssl) {
throw new InvalidConfigException(InvalidConfigException::ALIPAY_CONFIG_ERROR, 'Invalid alipay_root_cert');
}
$detail = $this->formatCert($ssl);
if ('sha1WithRSAEncryption' == $detail['signatureTypeLN'] || 'sha256WithRSAEncryption' == $detail['signatureTypeLN']) {
$sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']).'_';