Skip to content

Commit

Permalink
Merge pull request #154 from rubrikinc/TLS12Support
Browse files Browse the repository at this point in the history
Adding TLS 1.2 support for the PowerShell module
  • Loading branch information
chriswahl committed Jan 2, 2018
2 parents 8e5eff0 + 4fff0c9 commit eaaa84e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Rubrik/Public/Connect-Rubrik.ps1
Expand Up @@ -102,9 +102,23 @@ function Connect-Rubrik
}
}

Write-Verbose -Message 'Adding TLS 1.2'
#Force TLS 1.2
try{
if([Net.ServicePointManager]::SecurityProtocol -notcontains 'Tls12'){
[Net.ServicePointManager]::SecurityProtocol += [Net.SecurityProtocolType]::Tls12
}
}
catch
{
Write-Verbose -Message $_
Write-Verbose -Message $_.Exception.InnerException.Message
}

Write-Verbose -Message 'Submitting the request'
try
{

$r = Invoke-WebRequest -Uri $uri -Method $method -Body (ConvertTo-Json -InputObject $body) -Headers $head
$content = (ConvertFrom-Json -InputObject $r.Content)
# If we find a successful call code and also a token, we know the request was successful
Expand Down

0 comments on commit eaaa84e

Please sign in to comment.