Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dckorben committed Jan 31, 2025
1 parent 3397cdf commit b5cd42b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions QuickFIXn/Transport/SslStreamFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public Stream CreateClientStreamAndAuthenticate(Stream innerStream)
{
// Setup secure SSL Communication
X509CertificateCollection clientCertificates = GetClientCertificates();
if (_socketSettings.ServerCommonName is null)
{
if (_socketSettings.ServerCommonName is null) {
throw new AuthenticationException(
$"QuickFIX/n configuration '{SessionSettings.SSL_SERVERNAME}' is unset");
}
Expand Down Expand Up @@ -87,8 +86,7 @@ public Stream CreateServerStreamAndAuthenticate(Stream innerStream)

// Setup secure SSL Communication
X509Certificate2? serverCertificate = SslCertCache.LoadCertificate(_socketSettings.CertificatePath, _socketSettings.CertificatePassword);
if (serverCertificate is null)
{
if (serverCertificate is null) {
throw new AuthenticationException("Failed to load ServerCertificate");
}

Expand Down Expand Up @@ -171,8 +169,7 @@ private bool VerifyRemoteCertificate(
return false;

// Validate enhanced key usage
if (!ContainsEnhancedKeyUsage(certificate, enhancedKeyUsage))
{
if (!ContainsEnhancedKeyUsage(certificate, enhancedKeyUsage)) {
var role = enhancedKeyUsage == CLIENT_AUTHENTICATION_OID ? "client" : "server";
_nonSessionLog.OnEvent(
$"Remote certificate is not intended for {role} authentication: It is missing enhanced key usage {enhancedKeyUsage}");
Expand Down

0 comments on commit b5cd42b

Please sign in to comment.