且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xamarin:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚

更新时间:2021-10-24 05:50:23

//Use this, it worked for me. 

HttpClient client;

public class datastore {
   var httpClientHandler = new HttpClientHandler();
            
   httpClientHandler.ServerCertificateCustomValidationCallback = 
   (message, cert, chain, errors) => { return true; };

   client = new HttpClient(httpClientHandler);
}

//... use the client to make request. it will bypass 
//the ssl certificates verification.