c# - How to ignore SSL certificate validation in .Net-Core 2 on CentOS -


i'm building console application using .netcore 2.0

this application making rest call server running on "https" certificate not valid. support issue override "servercertificatecustomvalidationcallback" function:

        httpclienthandler httpclienthandler;          if (ignoresslerrors)         {             httpclienthandler = new httpclienthandler             {                 servercertificatecustomvalidationcallback = (message, certificate2, chain, errors) =>                 {                     log.warn($"invalid ssl/tls server certificate: {errors}");                     return true;                 }             };         }         else         {             httpclienthandler = new httpclienthandler();         }         httpclient httpclient = new httpclient(httpclienthandler, true); 

this .net core application work great on windows 10. when i'm running on centos 7 (1511 version) i'm getting error:

system.platformnotsupportedexception: handler not support custom handling of certificates combination of libcurl (7.29.0) , ssl backend ("nss/3.19.1 basic ecc"). @ system.net.http.curlhandler.sslprovider.setssloptionsforunsupportedbackend(easyrequest easy, clientcertificateprovider certprovider) @ system.net.http.curlhandler.sslprovider.setssloptions(easyrequest easy, clientcertificateoption clientcertoption) @ system.net.http.curlhandler.easyrequest.initializecurl() @ system.net.http.curlhandler.multiagent.activatenewrequest(easyrequest easy) --- end of stack trace previous location exception thrown ---

is bug in .netcore?

should update libraries in centos? can use alternative code work in centos?

solved in centos downloading newer version of "libcurl-openssl"

'yum install libcurl-openssl-7.43.0-1.1.x86_64.rpm' 

and redirect powershell discover new dynamic library.

set ld_library_path=/opt/shibboleth/lib64/:$ld_library_path 

more detailed information can found in these posts:

https://issues.couchbase.com/browse/ncbc-1296 https://github.com/powershell/powershell/issues/2511


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -