Skip to content

Commit 52090b9

Browse files
wfurtCopilot
andauthored
Add note clarifying TLS use in HttpListener (#128084)
doc only. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5f319f4 commit 52090b9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpConnection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public HttpConnection(Socket sock, HttpEndPointListener epl, bool secure, X509Ce
8484
else
8585
{
8686
#pragma warning disable CA5359
87+
// This part is actually never called because LoadCertificateAndKey always returns null
88+
// and for managed implementation we never negotiate TLS. If this ever changes we will need to re-think
89+
// how we deal with client certs and probably also remove "disable CA5359".
90+
// Doing full validation brings its own problems ... like AIA processing and possibly access to untrusted sites.
91+
// so that should probably be driven by user configuration.
8792
_sslStream = HttpListener.CreateSslStream(new NetworkStream(sock, false), false, (t, c, ch, e) =>
8893
{
8994
if (c == null)

0 commit comments

Comments
 (0)