Skip to content

Commit 9d253c4

Browse files
authored
Add SslProtocol Info to SecurableDuplexPipe (#222)
* Add SslProtocol Info to SecurableDuplexPipe Add the option of querying which SslProtocol was used to establish the connection is added for an encrypted connection * set SslProtocols default to SslProtocols.None
1 parent 1975ee2 commit 9d253c4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Src/SmtpServer/IO/SecurableDuplexPipe.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task UpgradeAsync(X509Certificate certificate, SslProtocols protoco
4343
await stream.AuthenticateAsServerAsync(certificate, false, protocols, true).ConfigureAwait(false);
4444

4545
_stream = stream;
46-
46+
4747
Input = PipeReader.Create(_stream);
4848
Output = PipeWriter.Create(_stream);
4949
}
@@ -88,5 +88,10 @@ public void Dispose()
8888
/// Returns a value indicating whether or not the current pipeline is secure.
8989
/// </summary>
9090
public bool IsSecure => _stream is SslStream;
91+
92+
/// <summary>
93+
/// Returns the used SslProtocol of a secure pipeline
94+
/// </summary>
95+
public SslProtocols SslProtocol => (_stream as SslStream)?.SslProtocol ?? SslProtocols.None;
9196
}
92-
}
97+
}

0 commit comments

Comments
 (0)