Skip to content

Conversation

MihaZupan
Copy link
Member

Closes #71836

@MihaZupan MihaZupan added this to the 9.0.0 milestone Jun 13, 2024
@MihaZupan MihaZupan requested a review from a team June 13, 2024 23:51
@MihaZupan MihaZupan self-assigned this Jun 13, 2024
@ghost
Copy link

ghost commented Jun 13, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost
Copy link

ghost commented Jun 13, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.


#pragma warning disable SYSLIB0014 // ServicePointManager is obsolete
_sslStream?.AuthenticateAsServer(_cert, true, (SslProtocols)ServicePointManager.SecurityProtocol, false);
#pragma warning restore SYSLIB0014
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SslStream part of this logic is currently unreachable - tracked by #19752

if (secure)
{
_secure = secure;
_cert = HttpListener.LoadCertificateAndKey(addr, port);
}

internal static X509Certificate? LoadCertificateAndKey(IPAddress addr, int port)
{
// TODO https://github.com/dotnet/runtime/issues/19752: Implement functionality to read SSL certificate.
return null;
}

if (_secure && _cert == null)
{
accepted.Close();
return;
}

namespace System.Net
{
// NOTE: While this class is not explicitly marked as obsolete,
// it effectively is by virtue of WebRequest.Create being obsolete.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why haven't we explicitly marked it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it was to reduce the noise for anyone still using it without suppressing it at the project level.
They must suppress the warning at least once when creating the request, but not everywhere else they might have plumbed the types through.

Copy link
Member

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obsolete ServicePointManager
4 participants