Skip to content

Commit

Permalink
Tell powershell to use TLS 1.2+ by default
Browse files Browse the repository at this point in the history
Github recently changed their webstack to only use newer TLS versions, so we need to tell Powershell to allow strong cryptography
  • Loading branch information
staticfloat authored Feb 26, 2018
1 parent 9258820 commit 92a68fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BinDeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ function download_cmd(url::AbstractString, filename::AbstractString)
elseif downloadcmd == :fetch
return `$downloadcmd -f $filename $url`
elseif endswith(string(downloadcmd), "powershell")
return `$downloadcmd -NoProfile -Command "(new-object net.webclient).DownloadFile(\"$url\", \"$filename\")"`
tls_cmd = "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
download_cmd = "(new-object net.webclient).DownloadFile(\"$(url)\", \"$(filename)\")"
return `$downloadcmd -NoProfile -Command "$(tls_cmd); $(download_cmd)"`
else
extraerr = Compat.Sys.iswindows() ? "check if powershell is on your path or " : ""
error("No download agent available; $(extraerr)install curl, wget, or fetch.")
Expand Down

0 comments on commit 92a68fd

Please sign in to comment.