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.

Self Contained Deployments throw exception when setting custom SSL certificate handlers

See original GitHub issue

Steps to reproduce

Within a .Net Core application running on Centos7/RHEL7 with the distribution standard libcurl installed, create an SSL session using e.g. WebClient and set a custom ServerCertificateValidationCallback, i.e.

ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;

Expected behavior

This should set a custom certificate validation callback and not raise an exception. (I.e. it should behave identically to a framework dependent build, and not vary in behavior depending on the specific linux distribution in use).

Actual behavior

On a Centos/RHEL7 machine, where libcurl is built against NSS instead of OpenSSL, an SCD build will throw System.PlatformNotSupportedException, i.e.:

Unhandled Exception: System.Net.WebException: An exception occurred during a WebClient request. —> System.PlatformNotSupportedException: The handler does not support custom handling of certificates with this combination of libcurl (7.29.0) and its SSL backend (“NSS/3.34”).

A framework dependent build will work just fine on the same machine. (On other distributions e.g. Ubuntu, where the system libcurl is built against OpenSSL, the self contained build will work correctly).

This has been demonstrated with both .Net Core 2.0 and 2.1.0-rc1

Environment data

dotnet --info output:

Host (useful for support): Version: 2.1.0-rc1 Commit: eb9bc92051

.NET Core SDKs installed: No SDKs were found.

.NET Core runtimes installed: Microsoft.NETCore.App 2.1.0-rc1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ajnewlandscommented, May 31, 2018

Thank you both for your help; I can confirm that a self contained build using the 2.1 release works perfectly. Happy for the issue to be closed.

0reactions
livarcocccommented, May 30, 2018

I am going to close this issue since the dependency on the library is gone in 2.1 and the issue is already being tracked for 2.0.

Let me know if we should leave it open for some reason.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Self Contained Deployments throw exception when setting ...
Within a .Net Core application running on Centos7/RHEL7 with the distribution standard libcurl installed, create an SSL session using e.g. ...
Read more >
HTTPClientHandler throwing exception when handling ...
I have build an API in .net core 3.1 with custom certificate handler for dynamically updating the certificate in sendasync request for ...
Read more >
.net - .net5 "Deploying a self-contained app" no localhost ...
net5 "Deploying a self-contained app" no localhost cert for ssl, no dotnet installed. This means that dotnet is probably not installed, which ...
Read more >
iOS 11 HTTPS network request failure with self-signed cert
For testing purpose, we use a self-signed cert, loaded as a bundle resource for network requests. It works fine on Xcode8 + iOS10...
Read more >
How to enable HTTPS in a Spring Boot Java application
How to generate an SSL self-signed certificate with keytool, enable HTTPS in Spring Boot, redirect from HTTP and distribute the certificate ...
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