mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-23 08:10:16 -05:00
Adds secure function for initialising client SSL stream reader
This commit is contained in:
parent
467f366c7c
commit
cf0c3e5602
1 changed files with 18 additions and 0 deletions
18
lib/web/Open-IcingaTCPClientConnection.psm1
Normal file
18
lib/web/Open-IcingaTCPClientConnection.psm1
Normal file
|
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue