mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
19 lines
478 B
PowerShell
19 lines
478 B
PowerShell
|
|
function Open-IcingaTCPClientConnection()
|
||
|
|
{
|
||
|
|
param(
|
||
|
|
[System.Net.Sockets.TcpClient]$Client = $null,
|
||
|
|
[Security.Cryptography.X509Certificates.X509Certificate2]$Certificate = $null
|
||
|
|
);
|
||
|
|
|
||
|
|
if ($null -eq $Client -Or $null -eq $Certificate) {
|
||
|
|
return $null;
|
||
|
|
}
|
||
|
|
|
||
|
|
$Stream = New-IcingaSSLStream -Client $Client -Certificate $Certificate;
|
||
|
|
|
||
|
|
return @{
|
||
|
|
'Client' = $Client;
|
||
|
|
'Stream' = $Stream;
|
||
|
|
};
|
||
|
|
}
|