We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
配置里,证书可能是一个文件,所以getAppCertSN()和getRootCertSN(),要先判断是否文件,再读取证书内容。 应该 各增加一行代码:if (file_exists($sign)) $sign = file_get_contents($sign);
/** * 新版 从证书中提取序列号 * @param string $sign * @return string */ private function getAppCertSN($sign) { if (file_exists($sign)) $sign = file_get_contents($sign); $ssl = openssl_x509_parse($sign, true); return md5($this->_arr2str(array_reverse($ssl['issuer'])) . $ssl['serialNumber']); } /** * 新版 提取根证书序列号 * @param string $sign * @return string|null */ private function getRootCertSN($sign) { $sn = null; if (file_exists($sign)) $sign = file_get_contents($sign); $array = explode('-----END CERTIFICATE-----', $sign); for ($i = 0; $i < count($array) - 1; $i++) { $ssl[$i] = openssl_x509_parse($array[$i] . '-----END CERTIFICATE-----', true); if (strpos($ssl[$i]['serialNumber'], '0x') === 0) { $ssl[$i]['serialNumber'] = $this->_hex2dec($ssl[$i]['serialNumberHex']); } if ($ssl[$i]['signatureTypeLN'] == 'sha1WithRSAEncryption' || $ssl[$i]['signatureTypeLN'] == 'sha256WithRSAEncryption') { if ($sn == null) { $sn = md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']); } else { $sn = $sn . '_' . md5($this->_arr2str(array_reverse($ssl[$i]['issuer'])) . $ssl[$i]['serialNumber']); } } } return $sn; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
配置里,证书可能是一个文件,所以getAppCertSN()和getRootCertSN(),要先判断是否文件,再读取证书内容。
应该
各增加一行代码:if (file_exists($sign)) $sign = file_get_contents($sign);
The text was updated successfully, but these errors were encountered: