Skip to content

Commit a8a65b8

Browse files
committed
Add SecurityProtocols >= Tls12.
1 parent e49643c commit a8a65b8

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Server/wwwroot/Content/Install-Remotely.ps1

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ param (
1818
[switch]$Quiet
1919
)
2020

21-
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
21+
#region Set SecurityProtocol
22+
# This will include all security protocols greater than or equal to TLS 1.2.
23+
[System.Net.SecurityProtocolType]$SecurityProtocols = 0;
24+
[System.Enum]::GetValues([System.Net.SecurityProtocolType]) | Where-Object {
25+
$_ -ge [System.Net.SecurityProtocolType]::Tls12
26+
} | ForEach-Object {
27+
$SecurityProtocols = $SecurityProtocols -bor $_
28+
}
29+
[System.Net.ServicePointManager]::SecurityProtocol = $SecurityProtocols
30+
#endregion
31+
32+
#region Set Variables
2233
$LogPath = "$env:TEMP\Remotely_Install.txt"
2334

2435
[string]$HostName = $null
@@ -41,7 +52,9 @@ else {
4152
}
4253

4354
$InstallPath = "$env:ProgramFiles\Remotely"
55+
#endregion
4456

57+
#region Functions
4558
function Write-Log($Message) {
4659
if (!$Quiet) {
4760
Write-Host $Message
@@ -185,6 +198,10 @@ function Install-Remotely {
185198
Start-Service -Name Remotely_Service
186199
}
187200

201+
#endregion
202+
203+
#region Main
204+
188205
try {
189206
Run-StartupChecks
190207

@@ -205,6 +222,7 @@ try {
205222
}
206223
catch {
207224
Write-Log -Message "Error occurred: $($Error[0].InvocationInfo.PositionMessage)"
208-
throw $Error[0]
225+
throw $Error[0]
209226
Do-Exit
210227
}
228+
#endregion

0 commit comments

Comments
 (0)