Commit 6003556
Get-DbaNetworkEncryption - Fix empty certificate properties by using SslStream.RemoteCertificate
Replace callback-based certificate capture ($script:capturedCertificate) with
$sslStream.RemoteCertificate. Scriptblock callbacks invoked by .NET do not
reliably write back to PowerShell session variables, so the captured variable
stayed null and New-Object X509Certificate2($null) produced an empty object.
Reading RemoteCertificate directly after AuthenticateAsClient is the correct
approach.
(do Get-DbaNetworkEncryption)
Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>1 parent 1de6d6d commit 6003556
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
336 | 336 | | |
337 | | - | |
338 | 337 | | |
339 | 338 | | |
340 | 339 | | |
| |||
346 | 345 | | |
347 | 346 | | |
348 | 347 | | |
349 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
| |||
0 commit comments