-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
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
我想问下我自己想引用证书,但是报错 #85
Comments
`class HttpClient def apiclient_cert=(cert) def apiclient_key=(key) 使用 |
报
检查你的 str 格式是不是合规 |
@jasl 是不是使用微信这个文件?apiclient_cert.p12? |
对,你这个问题是你没正确的把这个东西加载,而 Ruby 处理这个事情基本可以理解成是交给 OpenSSL,那么就是你在加载这个证书,在编码方式,证书密码 或者其他原因导致的问题 |
` # 证书加载
def set_apiclient_by_pkcs12(str)
pkcs12 = OpenSSL::PKCS12.new(str)
@apiclient_cert = pkcs12.certificate
@apiclient_key = pkcs12.key
end
def apiclient_cert=(cert)
@apiclient_cert = OpenSSL::X509::Certificate.new(cert)
end
def apiclient_key=(key)
@apiclient_key = OpenSSL::PKey::RSA.new(key)
end `
错误信息:
PKCS12_parse: mac verify failure
The text was updated successfully, but these errors were encountered: