Skip to content

Commit 347634f

Browse files
authored
Ignore SSL certificate errors (#109)
Signed-off-by: 迷渡 <[email protected]>
1 parent 2d86469 commit 347634f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

install.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ if (!(Test-Path $BinDir)) {
3131
New-Item $BinDir -ItemType Directory | Out-Null
3232
}
3333

34+
# Ignore SSL certificate errors
35+
# https://stackoverflow.com/questions/11696944/powershell-v3-invoke-webrequest-https-error
36+
add-type @"
37+
using System.Net;
38+
using System.Security.Cryptography.X509Certificates;
39+
public class TrustAllCertsPolicy : ICertificatePolicy {
40+
public bool CheckValidationResult(
41+
ServicePoint srvPoint, X509Certificate certificate,
42+
WebRequest request, int certificateProblem) {
43+
return true;
44+
}
45+
}
46+
"@
47+
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
48+
3449
Invoke-WebRequest $DvmUri -OutFile $DvmZip -UseBasicParsing
3550

3651
if (Get-Command Expand-Archive -ErrorAction SilentlyContinue) {

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fi
3434

3535
if [ "$1" = "" ]; then
3636
cd "$dvm_bin_dir"
37-
curl --fail --location --progress-bar --output "$exe.zip" "$dvm_uri"
37+
curl --fail --location --progress-bar -k --output "$exe.zip" "$dvm_uri"
3838
unzip -o "$exe.zip"
3939
rm "$exe.zip"
4040
else

0 commit comments

Comments
 (0)