Skip to content

Instantly share code, notes, and snippets.

@pedro-w
Created April 9, 2018 10:34
Show Gist options
  • Save pedro-w/5359d8a4f75767d88cca4fb9aaaffc8e to your computer and use it in GitHub Desktop.
Save pedro-w/5359d8a4f75767d88cca4fb9aaaffc8e to your computer and use it in GitHub Desktop.
Lein Windows Security Error
>lein self-install
Downloading Leiningen now...
Exception calling "DownloadFile" with "2" argument(s): "The request was
aborted: Could not create SSL/TLS secure channel."
At line:1 char:145
+ ... che]::DefaultNetworkCredentials; $client.DownloadFile($a, $f)} "https ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
Failed to download https://github.com/technomancy/leiningen/releases/download/2.8.1/leiningen-2.8.1-standalone.zip
It is possible that the download failed due to "powershell",
"curl" or "wget"'s inability to retrieve GitHub's security certificate.
The suggestions below do not check certificates, so use this only if
you understand the security implications of not doing so.
The PowerShell failed to download the latest Leiningen version.
Try to use "curl" or "wget" to download Leiningen by setting up
the HTTP_CLIENT environment variable with one of the following
values:
a) set HTTP_CLIENT=wget --no-check-certificate -O
b) set HTTP_CLIENT=curl -f -L -k -o
NOTE: Make sure to *not* add double quotes when setting the value
of HTTP_CLIENT
--- lein.bat.original 2018-04-09 11:27:07.549354500 +0100
+++ lein.bat 2018-04-09 11:28:43.442263400 +0100
@@ -154,7 +154,7 @@
call powershell -? >nul 2>&1
if NOT ERRORLEVEL 0 goto TRY_WGET
set LAST_HTTP_CLIENT=powershell
- powershell -Command "& {param($a,$f) $client = New-Object System.Net.WebClient; $client.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $client.DownloadFile($a, $f)}" ""%2"" ""%1""
+ powershell -Command "& {param($a,$f) $client = New-Object System.Net.WebClient; [Net.ServicePointManager]::SecurityProtocol = 'tls12' ; $client.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials; $client.DownloadFile($a, $f)}" ""%2"" ""%1""
SET RC=%ERRORLEVEL%
goto EXITRC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment