我使用版本为2.0+的http-conduit
库从http://
URL获取内容:
import Network.HTTP.Conduit
myurl = ... -- Your URL goes here
main = do content <- simpleHttp myurl
print $ content
运行此程序时,我遇到了以下错误:
*** Exception: TlsException (HandshakeFailed (Error_Protocol
("certificate rejected: certificate is not allowed to sign another certificate",
True,CertificateUnknown)))
根据错误信息可以看出,问题在于Network.HTTP.Conduit
无法适当地验证服务器证书(在本例中,证书链似乎存在问题)
我该如何更改上面的代码以忽略证书错误(即根本不验证证书)?