1

Trying to update ghcup with ghc (ghcup install ghc 9.4.3) results in an error:

[ Warn  ] New cabal version available. To upgrade, run 'ghcup install cabal 3.8.1.0'
[ Info  ] verifying digest of: gs.exe
[ Info  ] downloading: https://downloads.haskell.org/~ghc/9.4.3/ghc-9.4.3-x86_64-unknown-mingw32.tar.xz as file C:\ghcup\tmp\ghcup-ad812d90b7e92bc1\ghc-9.4.3-x86_64-unknown-mingw32.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - Функция отзыва не смогла произвести проверку отзыва для сертификата.
[ Error ] Download failed: Process "curl" with arguments ["-fL", "-o",
[ ...   ]                                                 "C:\\ghcup\\tmp\\ghcup-ad812d90b7e92bc1\\ghc-9.4.3-x86_64-unknown-mingw32.tar.xz.tmp",
[ ...   ]                                                 "https://downloads.haskell.org/~ghc/9.4.3/ghc-9.4.3-x86_64-unknown-mingw32.tar.xz"] failed with exit code 35.
[ Error ] Also check the logs in C:\ghcup\logs

This is what logs say:

Debug: Identified Platform as: Windows
Debug: last access was 9.7176814s ago, cache interval is 300s
Debug: Decoding yaml at: C:\ghcup\cache\ghcup-0.0.7.yaml
Warn: New cabal version available. To upgrade, run 'ghcup install cabal 3.8.1.0'
Info: verifying digest of: gs.exe
Debug: Requested to install GHC with 9.4.3
Info: downloading: https://downloads.haskell.org/~ghc/9.4.3/ghc-9.4.3-x86_64-unknown-mingw32.tar.xz as file C:\ghcup\tmp\ghcup-ad812d90b7e92bc1\ghc-9.4.3-x86_64-unknown-mingw32.tar.xz
Error: Download failed: Process "curl" with arguments ["-fL", "-o",
                                                "C:\\ghcup\\tmp\\ghcup-ad812d90b7e92bc1\\ghc-9.4.3-x86_64-unknown-mingw32.tar.xz.tmp",
                                                "https://downloads.haskell.org/~ghc/9.4.3/ghc-9.4.3-x86_64-unknown-mingw32.tar.xz"] failed with exit code 35.
Error: Also check the logs in C:\ghcup\logs

i tried using the curl command they say leads to an error from powershell (curl.exe -fL -o "C:\ghcup\tmp\ghcup-3da46c8d7d5a204f\ghc-9.2.5-x86_64-unknown-mingw32.tar.xz.tmp" "https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-x86_64-unknown-mingw32.tar.xz") it also throws an error: "curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) -"

orsnmkhl
  • 11
  • 1
  • What those logs say? – Poselsky Jan 05 '23 at 13:15
  • the block after "This is what logs say:" is the entire content of the only log file in C:\ghcup\logs. there's nothing else in the logs – orsnmkhl Jan 05 '23 at 13:34
  • `failed with exit code 35` - This means that there's an SSL connection error. Try running your curl.exe with the `-k` flag. What's your OS, btw? If it's Windows 7, and the remote side is using something like Let's Encrypt, you'll need to include the `-k` in all your cURL requests towards it. – FiddlingAway Jan 05 '23 at 13:36
  • Okay, that works for running curl manually, but how do i get ghcup to run curl with that flag? – orsnmkhl Jan 05 '23 at 14:32

1 Answers1

0

You can pass options to Curl via the GHCUP_CURL_OPTS environment variable.

According to Google Translate, the Russian "sub-error" message after the error code reads "The revocation function was unable to perform a revocation check on the certificate." So, it may be sufficient to pass the somewhat safer --ssl-revoke-best-effort or, failing that, the --ssl-no-revoke flag, which will only shut off the revocation check, rather than the -k flag which allows for completely insecure connections.

In short, in PowerShell, you may find that it's sufficient to run:

$Env:GHCUP_CURL_OPTS = '--ssl-revoke-best-effort'

before running ghcup.

It's a bit of a concern that the revocation check is failing, though. If you try to access https://downloads.haskell.org via a web browser, do you get any similar errrors?

K. A. Buhr
  • 45,621
  • 3
  • 45
  • 71