Stack(Haskell)在Windows中抛出TlsException [英] Stack (Haskell) throws TlsException in Windows
问题描述
Stack (在Windows下)在尝试下载文件时有时会引发以下异常(例如,在 stack setup
或下载构建计划时):
TlsException(HandshakeFailed(Error_Protocol有未知的CA,True,UnknownCa)))。
如何避免此错误?
(这已在 https://github.com/commercialhaskell/stack/issues/234上讨论并解决a>,我正在重新发布这个问题以使解决方案更加可用。)
这是由于未找到证书通过 stack
访问各种网站。可以通过在Internet Explorer中打开正确的网页(它会自动添加证书),然后再次启动堆栈来修复它。
要找出哪个网页堆栈访问,运行使用详细选项(-v)进行堆栈以查看失败前的最后一次尝试下载。例如:
C:\> stack -v setup
...某些输出...
2015-09-18 14:19:14.9807056:[debug]从https://www.haskell.org/ghc/dist/下载7.10.1 / ghc-7.10.1-i386-unknown-mingw32.tar.xz到C:\ ... @(stack_GXibO6avQtx8ez3M6BHFie:Stack.Setup src / Stack\Setup.hs:845:5)
TlsException(HandshakeFailed(Error_Protocol(certificate has unknown CA,True,UnknownCa)))
注意:确切的消息可能会有所不同,因为现在我的计算机上已经解决了这个问题,所以我无法在不重新安装Windows的情况下重现确切的错误。)
因此,堆栈正在从< a href =https://www.haskell.org/ =noreferrer> https://www.haskell.org/ ,所以我们需要打开 https://www.haskell.org/ 。之后堆栈应该可以工作(可能需要重复此步骤才能添加不同的证书)。
其他似乎可以访问的堆栈是: https://github.com , https:// www。 stackage.org 。
这个解决方案已在Win 7 32-bit和Stack 0.1.4.0上验证。
Stack (under Windows) sometimes throws the following exception when trying to download files (e.g., during stack setup
or while downloading a build plan):
TlsException (HandshakeFailed (Error_Protocol ("certificate has unknown CA",True,UnknownCa))).
How to get around this error if it occurs?
(This was discussed and solved on https://github.com/commercialhaskell/stack/issues/234, I am reposting the question to make the solution more available.)
This is due to a certificates not being found by stack
when accessing various website. It can be fixed by opening the correct webpage in Internet Explorer (which automatically adds the certificate), and then starting stack again.
To find out which webpage stack accesses, run stack with the verbose option (-v) to see the last attempted download before the failure. E.g.:
C:\> stack -v setup
... some output ...
2015-09-18 14:19:14.9807056: [debug] Downloading from https://www.haskell.org/ghc/dist/7.10.1/ghc-7.10.1-i386-unknown-mingw32.tar.xz to C:\... @(stack_GXibO6avQtx8ez3M6BHFie:Stack.Setup src/Stack\Setup.hs:845:5)
TlsException (HandshakeFailed (Error_Protocol ("certificate has unknown CA",True,UnknownCa)))
(Note: The exact messages may differ. Because the problem is solved on my computer now, I cannot reproduce the exact error without reinstalling Windows.)
So stack is downloading from https://www.haskell.org/, so we need to open https://www.haskell.org/ in Internet explorer. Afterwards stack should work (possibly you need to repeat this step to add different certificates).
Other webpages which stack seems to access are: https://github.com, https://www.stackage.org.
This solution is verified on Win 7 32-bit with Stack 0.1.4.0.
这篇关于Stack(Haskell)在Windows中抛出TlsException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!