question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow a custom HttpMessageHandler to support overriding the verification of Self-Signed SSL certificates.

See original GitHub issue

With the V2 client now using the latest framework it is possible to override the HttpMessageHandler and override self-signed certificate checking.

	var handler = new HttpClientHandler();
	handler.ClientCertificateOptions = ClientCertificateOption.Manual;
	handler.ServerCertificateCustomValidationCallback += DangerousAcceptAnyServerCertificateValidator;

	_client = new DocumentClient(new Uri(_documentDbOptions.Endpoint), _documentDbOptions.Key, handler);

However with the V3 client, there is no ability to do this. Can we look for a suitable way to do this?

Self-Signed certification verification overrides are required when running on Linux clients that wish to connect to the emulator. Despite all of the good work that has been done with the emulator such as allowing you to specify the alternative subject names for the self-signed certificate and export it, there are still limitations. I’ve found that the Linux implementation of .NET core that uses cURL/OpenSSL will still error with a self-signed certificate, even if you install it into the ca-certificates store. (Windows will honor the certificate if you put it into the Trusted Certificate Authorities store).

It would be preferable to use the V3 SDK rather than the V2.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
zhengwiacommented, Aug 13, 2019

Hi any plan on this pr going to release? Same situation working behind a corporate firewall. Thanks.

1reaction
galvesribeirocommented, Nov 15, 2019

Folks, how is that PR fixing the SSL bypass issue? I don’t see how to set the HttpClientHandler or other way to ignore the SSL cert. I’m on OSX with the same issue on the emulator…

Can someone shed a light on this? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allowing Untrusted SSL Certificates with HttpClient
This allows you to provide your own certificate validation. ... Verifies that specific self signed root certificates are trusted.
Read more >
Run the agent with a self-signed certificate - Azure Pipelines
Learn how to run the build and release agent with a self-signed certificate for Azure Pipelines and Team Foundation Server (TFS)
Read more >
Certificate Pinning in Android Application with Xamarin
Validating Server Certificates (i.e. Android Certificate Pinning). The other alternative to working with self signed certificates is to override ...
Read more >
Trusting a Self-Signed Certificate in OkHttp
Overriding the HostnameVerifier. The last step towards configuring the OkHttpClient correctly is to disable the default HostnameVerifier and ...
Read more >
Set or Get Self-Signed SSL Certificates for Skill Endpoints ...
Set or Get Self-Signed SSL Certificates for Skill Endpoints for Testing. Note: Sign in to the developer console to build or publish your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found