mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
12 lines
467 B
PowerShell
12 lines
467 B
PowerShell
function New-IcingaSSLStream()
|
|
{
|
|
param(
|
|
[System.Net.Sockets.TcpClient]$Client = @{},
|
|
[Security.Cryptography.X509Certificates.X509Certificate2]$Certificate = $null
|
|
);
|
|
|
|
$SSLStream = New-Object System.Net.Security.SslStream($Client.GetStream(), $false)
|
|
$SSLStream.AuthenticateAsServer($Certificate, $false, [System.Security.Authentication.SslProtocols]::Tls12, $true) | Out-Null;
|
|
|
|
return $SSLStream;
|
|
}
|