Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Hannebauer committed Oct 28, 2024
1 parent 8600b94 commit 3d13e93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions SCEPman/Private/estclient.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@ Function RenewCertificateMTLS {
# HttpClientHandler works generally for mTLS.
# However, it only works with certificates having the Client Authentication EKU. This is because Certificate Helper filters for this EKU: https://github.com/dotnet/runtime/blob/a0fdddab98ad95186d84d4667df4db8a4e651990/src/libraries/Common/src/System/Net/Security/CertificateHelper.cs#L12
# And HttpClientHandler sets this method as the Callback: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs#L271

# Hence, we need to use SocketsHttpHandler instead. It allows more control over the SSL options.
Write-Debug "Cert Has Private Key: $($Certificate.HasPrivateKey)"
$handler = New-Object SocketsHttpHandler


# SocketsHttpHandler's ClientCertificateOptions is internal. So we need to use reflection to set it. If we leave it at 'Automatic', it would require the certificate to be in the store.
try {
Expand Down
2 changes: 1 addition & 1 deletion Tests/Update-CertificateViaEST.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Describe 'SimpleReenrollmentTools' -Skip:(-not $IsWindows) {
$privateKey = [System.Security.Cryptography.RSA]::Create($Certificate.PublicKey.Key.KeySize)
$oCertRequest = [System.Security.Cryptography.X509Certificates.CertificateRequest]::new($Certificate.Subject, $privateKey, [System.Security.Cryptography.HashAlgorithmName]::SHA256, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)
$sCertRequest = $oCertRequest.CreateSigningRequestPem()

$leafCertificate = IssueCertificate($sCertRequest)

$collection = [System.Security.Cryptography.X509Certificates.X509Certificate2Collection]::new()
Expand Down

0 comments on commit 3d13e93

Please sign in to comment.