我是使用 openSSL 和证书做和不做的新手。
在我的接收器文件中,我使用 SecurityContext 来强制使用 HTTP:
@override
SecurityContext get securityContext {
return new SecurityContext()
..usePrivateKey("SSL/key.pem", password: keypassword)
..useCertificateChain("SSL/cert.pem", password: certpassword);
}
我在本地开发并使用 OpenSSL 创建了自签名密钥和证书。通过 aqueduct serve 运行应用程序时,我没有任何问题(除了通过相应的浏览器确认我知道证书不是 CA 签名的)但是在运行我的测试时我收到以下错误:
HandshakeException: Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: self signed certificate(ssl_cert.c:345))
这是否意味着我需要使用 CA 签名证书来避免这种情况?