我编写了一个CRUD应用程序来与JIRA交互。我最终升级了我的haskell环境,因为cabal dev并不能解决所有问题。因此,每当我尝试使用任何与JIRA接口的代码时,我都会遇到这个错误。
Spike: HandshakeFailed (Error_Misc "user error (unexpected type received. expecting
handshake and got: Alert [(AlertLevel_Warning,UnrecognizedName)])")通过谷歌搜索,我认为这要么与tls有关,要么与使用tls的http-conduit有关。
我目前使用的是tls-1.1.2和http-conduit-1.8.7.1,之前我使用的是tls-0.9.11和http-conduit >= 1.5 && < 1.7 (不确定具体是哪一个,旧的安装已经不存在了。
这就是我相信突破发生的地方。
manSettings :: ManagerSettings
manSettings = def { managerCheckCerts = \ _ _ _-> return CertificateUsageAccept }这就是它过去的样子
manSettings :: ManagerSettings
manSettings = def { managerCheckCerts = \ _ _ -> return CertificateUsageAccept }下面是使用它的代码
initialRequest :: forall (m :: * -> *). URI -> IO (Request m,Manager)
initialRequest uri = do
initReq <- parseUrl uri -- let the server tell you what the request header
-- should look like
manager <- newManager manSettings -- a Manager manages http connections
-- we mod the settings to handle
-- the SSL cert. See manSettings below.
return (modReq initReq,manager)
where modReq initReq = applyBasicAuth username password initReq如果我遗漏了什么,请告诉我。在这一点上,我不确定从那时到现在之间发生了什么。
发布于 2013-02-14 13:19:22
这是一个很好的错误来源猜测,但可能性很小: managerCheckCerts只是使用证书包来检查证书的有效性。您看到的错误消息似乎来自tls本身,表明数据传输失败。向tls提交错误报告可能是一个好主意,最好首先将问题范围缩小到一个失败的HTTPS调用(或者更好的做法是,单独使用tls并演示相同的失败)。
https://stackoverflow.com/questions/14863235
复制相似问题