Skip to content

Commit

Permalink
Add SecurityProtocols >= Tls12.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Jun 27, 2024
1 parent e49643c commit a8a65b8
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Server/wwwroot/Content/Install-Remotely.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ param (
[switch]$Quiet
)

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
#region Set SecurityProtocol
# This will include all security protocols greater than or equal to TLS 1.2.
[System.Net.SecurityProtocolType]$SecurityProtocols = 0;
[System.Enum]::GetValues([System.Net.SecurityProtocolType]) | Where-Object {
$_ -ge [System.Net.SecurityProtocolType]::Tls12
} | ForEach-Object {
$SecurityProtocols = $SecurityProtocols -bor $_
}
[System.Net.ServicePointManager]::SecurityProtocol = $SecurityProtocols
#endregion

#region Set Variables
$LogPath = "$env:TEMP\Remotely_Install.txt"

[string]$HostName = $null
Expand All @@ -41,7 +52,9 @@ else {
}

$InstallPath = "$env:ProgramFiles\Remotely"
#endregion

#region Functions
function Write-Log($Message) {
if (!$Quiet) {
Write-Host $Message
Expand Down Expand Up @@ -185,6 +198,10 @@ function Install-Remotely {
Start-Service -Name Remotely_Service
}

#endregion

#region Main

try {
Run-StartupChecks

Expand All @@ -205,6 +222,7 @@ try {
}
catch {
Write-Log -Message "Error occurred: $($Error[0].InvocationInfo.PositionMessage)"
throw $Error[0]
throw $Error[0]
Do-Exit
}
#endregion

0 comments on commit a8a65b8

Please sign in to comment.