diff --git a/lib/web/Open-IcingaTCPClientConnection.psm1 b/lib/web/Open-IcingaTCPClientConnection.psm1 new file mode 100644 index 0000000..ade1bf2 --- /dev/null +++ b/lib/web/Open-IcingaTCPClientConnection.psm1 @@ -0,0 +1,18 @@ +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; + }; +}