private static void SetCertificatePolicy()
        {
            if( ServicePointManager.ServerCertificateValidationCallback==null){
                ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;
            }
        }
        /// <summary>  
        /// 远程证书验证,固定返回true 
        /// </summary>  
        private static bool RemoteCertificateValidate(object sender, X509Certificate cert,
            X509Chain chain, SslPolicyErrors error)
        {
            return true;
        } 

 在linux上使用mono发起https的请求,发现会会有ssl错误,搜索后在stackoverflow上搜索所得,在发起请求钱加上全局的注册,这样就可以防止出错。注册一次即可,无需多次。

相关文章:

  • 2021-08-05
  • 2022-03-07
  • 2022-12-23
  • 2021-10-02
  • 2021-11-08
  • 2021-10-08
  • 2021-10-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-08-03
  • 2021-09-17
  • 2021-08-31
  • 2021-12-31
相关资源
相似解决方案