Skip to content

Deprecate service point for server certificate #4731

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

Merged
merged 7 commits into from
Nov 4, 2020

Conversation

aik-jahoda
Copy link
Contributor

@aik-jahoda aik-jahoda commented Aug 27, 2020

Service point no longer supports server certificate. This PR link to HttpClient including C# example

Partially fixes dotnet/runtime#33125

fixes dotnet/runtime#24773

@aik-jahoda aik-jahoda requested a review from a team August 27, 2020 09:28
@opbld34

This comment has been minimized.

@opbld32

This comment has been minimized.

static async Task Main()
{
// Create an HttpClientHandler object and set to use default credentials
HttpClientHandler handler = new HttpClientHandler();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
HttpClientHandler handler = new HttpClientHandler();
var handler = new HttpClientHandler();

handler.ServerCertificateCustomValidationCallback = ServerCertificateCustomValidation;

// Create an HttpClient object
HttpClient client = new HttpClient(handler);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
HttpClient client = new HttpClient(handler);
var client = new HttpClient(handler);

Co-authored-by: Youssef Victor <31348972+Youssef1313@users.noreply.github.com>
@opbld30

This comment has been minimized.

Co-authored-by: Youssef Victor <31348972+Youssef1313@users.noreply.github.com>
@opbld32

This comment has been minimized.

@aik-jahoda aik-jahoda closed this Sep 2, 2020
@aik-jahoda aik-jahoda deleted the jajahoda/servicepointcert branch September 2, 2020 12:49
@aik-jahoda aik-jahoda restored the jajahoda/servicepointcert branch September 29, 2020 12:09
@aik-jahoda aik-jahoda reopened this Sep 29, 2020
@opbld34
Copy link

opbld34 commented Sep 29, 2020

Docs Build status updates of commit e0a74f0:

⚠️ Validation status: warnings

File Status Preview URL Details
xml/System.Net.Http/HttpClientHandler.xml ⚠️Warning View Details
xml/Microsoft.Extensions.DependencyInjection/PollyServiceCollectionExtensions.xml ⚠️Warning View Details
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/program.cs ✅Succeeded
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/system.net.http.httpclienthandler-secure.csproj ✅Succeeded
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs ✅Succeeded View
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/system.net.http.httpclienthandler.csproj ✅Succeeded
xml/System.Net/ServicePoint.xml ✅Succeeded View
xml/System.Net/ServicePointManager.xml ✅Succeeded View

xml/System.Net.Http/HttpClientHandler.xml

  • Line 0, Column 0: [Warning-codesnippet-not-found] Invalid code snippet link: '~/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/secure.cs'.

xml/Microsoft.Extensions.DependencyInjection/PollyServiceCollectionExtensions.xml

  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.PolicyRegistry'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IReadOnlyPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IReadOnlyPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.PolicyRegistry'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.
  • Line 0, Column 0: [Warning-xref-not-found] Cross reference not found: 'Polly.Registry.IPolicyRegistry`1'.

For more details, please refer to the build report.

If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

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.

Small typo, otherwise LGTM!

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
@opbld30
Copy link

opbld30 commented Nov 4, 2020

Docs Build status updates of commit ea0b715:

⚠️ Validation status: warnings

File Status Preview URL Details
xml/System.Net.Http/HttpClientHandler.xml ⚠️Warning View Details
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/program.cs ✅Succeeded
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/system.net.http.httpclienthandler-secure.csproj ✅Succeeded
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs ✅Succeeded View
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/system.net.http.httpclienthandler.csproj ✅Succeeded
xml/System.Net/ServicePoint.xml ✅Succeeded View
xml/System.Net/ServicePointManager.xml ✅Succeeded View

xml/System.Net.Http/HttpClientHandler.xml

  • Line 0, Column 0: [Warning-codesnippet-not-found] Invalid code snippet link: '~/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/secure.cs'.

For more details, please refer to the build report.

If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Docs Build.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

Note: Your PR may contain errors or warnings unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@opbld30
Copy link

opbld30 commented Nov 4, 2020

Docs Build status updates of commit a79eb72:

✅ Validation status: passed

File Status Preview URL Details
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/program.cs ✅Succeeded View
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler-secure/cs/system.net.http.httpclienthandler-secure.csproj ✅Succeeded
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs ✅Succeeded View
samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/system.net.http.httpclienthandler.csproj ✅Succeeded
xml/System.Net.Http/HttpClientHandler.xml ✅Succeeded View
xml/System.Net/ServicePoint.xml ✅Succeeded View
xml/System.Net/ServicePointManager.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@aik-jahoda aik-jahoda merged commit f3d08e7 into dotnet:master Nov 4, 2020
@aik-jahoda aik-jahoda deleted the jajahoda/servicepointcert branch November 4, 2020 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obsolete old HTTP APIs ServicePoint retrieved via FindServicePoint does not contain server certificate
6 participants