Skip to content

Fix TLS handshake failure during download#476

Open
kianmeng wants to merge 1 commit intondmitchell:masterfrom
myfloss:fix-tls-handshake-error-during-download
Open

Fix TLS handshake failure during download#476
kianmeng wants to merge 1 commit intondmitchell:masterfrom
myfloss:fix-tls-handshake-error-during-download

Conversation

@kianmeng
Copy link
Copy Markdown

@kianmeng kianmeng commented May 6, 2026

Use 'ciphersuite_strong' in the TLS manager to resolve handshake failures (DecodeError) due to rejection of weak cipher from remote server when building database through hoogle generate.

Before:

$ hoogle generate                                                               
                                                                                                            
Starting generate                                                                                           
Downloading https://www.stackage.org/lts/cabal.config... hoogle: Uncaught exception http-client-0.7.19-e53e031a3080635351a782ae473941335ff5cb434b654af0da963246f7167366:Network.HTTP.Client.Types.HttpException:
                                                                                                            
HttpExceptionRequest Request {                        
  host                 = "www.stackage.org"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/lts/cabal.config"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
  proxySecureMode      = ProxySecureWithConnect
}
 (InternalException (HandshakeFailed (Error_Protocol "expecting server hello, got alert : [(AlertLevel_Fatal,DecodeError)]" HandshakeFailure)))                                                                          

While handling HttpExceptionRequest Request {
  |   host                 = "www.stackage.org"
  |   port                 = 443
  |   secure               = True
  |   requestHeaders       = []
  |   path                 = "/lts/cabal.config"
  |   queryString          = ""
  |   method               = "GET"
  |   proxy                = Nothing
  |   rawBody              = False
  |   redirectCount        = 10
  |   responseTimeout      = ResponseTimeoutDefault
  |   requestVersion       = HTTP/1.1
  |   proxySecureMode      = ProxySecureWithConnect
  | }
  |  (InternalException (HandshakeFailed (Error_Protocol "expecting server hello, got alert : [(AlertLevel_Fatal,DecodeError)]" HandshakeFailure)))                                                                      

HasCallStack backtrace:
  throwIO, called at ./Control/Monad/Trans/Resource.hs:195:13 in resourcet-1.3.0-7299c6173b690f5eb16d3064231923041dd3dc557a27f9dbaf609a7a01dc2448:Control.Monad.Trans.Resource         

After:

$ hoogle -- generate
Starting generate
Downloading https://www.stackage.org/lts/cabal.config... 1.41s
Downloading https://www.stackage.org/nightly/cabal.config... 1.43s
Downloading https://raw.githubusercontent.com/haskell/haskell-platform/master/hptool/src/Releases2015.hs... 1.10s
Downloading https://hackage.haskell.org/packages/index.tar.gz... 5m08s
Downloading https://hackage.haskell.org/packages/hoogle.tar.gz... 
...

Use 'ciphersuite_strong' in the TLS manager to resolve handshake
failures (DecodeError) due to rejection of weak cipher from remote
server when building database through `hoogle generate`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant