···
1
-
From c8ca5e14650a77446a6577eb356ddd09c3928bac Mon Sep 17 00:00:00 2001
2
-
From: Ben Millwood <thebenmachine+git@gmail.com>
3
-
Date: Tue, 17 Jun 2025 16:39:07 +0100
4
-
Subject: [PATCH] Fix TLS connection to package.elm-lang.org
6
-
It seems like the server hosting https://package.elm-lang.org has an old
7
-
enough SSL library that it doesn't support EMS. Reconfigure the https
8
-
client so that it will still connect in this case.
10
-
builder/src/Http.hs | 21 +++++++++++++++++++--
12
-
2 files changed, 22 insertions(+), 2 deletions(-)
14
-
diff --git a/builder/src/Http.hs b/builder/src/Http.hs
15
-
index 6105263fa..fd8b87bba 100644
16
-
--- a/builder/src/Http.hs
17
-
+++ b/builder/src/Http.hs
18
-
@@ -29,15 +29,19 @@ import qualified Data.Binary as Binary
19
-
import qualified Data.Binary.Get as Binary
20
-
import qualified Data.ByteString.Builder as B
21
-
import qualified Data.ByteString.Char8 as BS
22
-
+import Data.Default (def)
23
-
import qualified Data.Digest.Pure.SHA as SHA
24
-
import qualified Data.String as String
25
-
+import qualified Network.Connection as NC
26
-
import Network.HTTP (urlEncodeVars)
27
-
import Network.HTTP.Client
28
-
-import Network.HTTP.Client.TLS (tlsManagerSettings)
29
-
+import Network.HTTP.Client.TLS (mkManagerSettings)
30
-
import Network.HTTP.Types.Header (Header, hAccept, hAcceptEncoding, hUserAgent)
31
-
import Network.HTTP.Types.Method (Method, methodGet, methodPost)
32
-
import qualified Network.HTTP.Client as Multi (RequestBody(RequestBodyLBS))
33
-
import qualified Network.HTTP.Client.MultipartFormData as Multi
34
-
+import qualified Network.TLS as TLS
35
-
+import Network.TLS.Extra.Cipher (ciphersuite_default)
37
-
import qualified Json.Encode as Encode
38
-
import qualified Elm.Version as V
39
-
@@ -49,7 +53,20 @@ import qualified Elm.Version as V
41
-
getManager :: IO Manager
43
-
- newManager tlsManagerSettings
44
-
+ newManager (mkManagerSettings dontRequireEMS Nothing)
46
-
+ -- See https://github.com/NixOS/nixpkgs/pull/414495
48
-
+ NC.TLSSettingsSimple
49
-
+ { NC.settingDisableCertificateValidation = False
50
-
+ , NC.settingDisableSession = False
51
-
+ , NC.settingUseServerName = False
52
-
+ , NC.settingClientSupported =
54
-
+ { TLS.supportedCiphers = ciphersuite_default
55
-
+ , TLS.supportedExtendedMainSecret = TLS.AllowEMS
61
-
diff --git a/elm.cabal b/elm.cabal
62
-
index 144fada90..0bd1eb5dc 100644
65
-
@@ -206,6 +206,8 @@ Executable elm
69
-
+ crypton-connection,
74
-
@@ -229,6 +231,7 @@ Executable elm
79
-
unordered-containers,