Merge pull request #518 from guardicore/hotfix/add-tls-version-to-powershell-script-http-pba

Added TLS version to powershell command.
This commit is contained in:
Shay Nehmad 2019-12-26 16:13:44 +02:00 committed by GitHub
commit a98ea150b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,9 @@ class CommunicateAsNewUser(PBA):
@staticmethod
def get_commandline_for_http_request(url, is_windows=is_windows_os()):
if is_windows:
format_string = 'powershell.exe -command "Invoke-WebRequest {url}" -UseBasicParsing'
format_string = \
'powershell.exe -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ' \
'Invoke-WebRequest {url} -UseBasicParsing"'
else:
# true || false -> 0. false || true -> 0. false || false -> 1. So:
# if curl works, we're good.