Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsolete ServicePointManager 🎉 #103456

Merged
merged 2 commits into from
Jun 15, 2024
Merged

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
Copy link

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
Copy link

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.

_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;
}

@@ -9,6 +9,8 @@

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