突破的变化在哪里?

时间:2013-02-13 21:12:08

标签: haskell yesod

我写了一个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.2http-conduit-1.8.7.1 以前我用过 tls-0.9.11http-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

如果我遗漏了某些东西,请告诉我。我现在还不确定当时和现在之间发生了什么。

1 个答案:

答案 0 :(得分:4)

这是一个很好的猜测错误来源,但非常不可能:managerCheckCerts只是使用证书包来检查证书的有效性。您看到的错误消息似乎来自tls本身并表示数据传输失败。使用tls提交错误报告可能是一个好主意,最好首先将问题缩小到单个HTTPS调用失败(甚至更好,单独使用tls并演示相同的失败)。