Skip to content

Commit

Permalink
Merge pull request #354 from JuliaLang/sf/tls12
Browse files Browse the repository at this point in the history
Tell powershell to use TLS 1.2+ by default
  • Loading branch information
simonbyrne authored Feb 26, 2018
2 parents 9258820 + 92a68fd commit a042547
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 a042547

Please sign in to comment.