首页新闻找找看学习计划

在wince(PDA终端上)运行https请求,握手失败

0
悬赏园豆:5 [待解决问题]

运行到Stream stream = request.GetRequestStream()就报错,

 


报握手失败,请参阅内部异常。

位于 System.Net.SslConnectionState.PerformClientHandShake()
位于 System.Net.Connection.connect(Object ignored)
位于 System.Threading.ThreadPool.WorkItem.doWork(Object o)
位于 System.Threading.Timer.ring()
}

 

代码也加了 验证

ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();

 

public class TrustAllCertificatePolicy : ICertificatePolicy
    {
        public TrustAllCertificatePolicy() { }

        public bool CheckValidationResult(
        ServicePoint srvPoint
        , X509Certificate certificate
        , WebRequest request
        , int certificateProblem)
        {
            LogHelper.LogInfo("name: " + certificate.GetName());

            LogHelper.LogInfo("issuer name: " + certificate.GetIssuerName());

            System.Diagnostics.Trace.WriteLine("name: " + certificate.GetName());
            //总接受
            return true;
        }
 }
Gavin_Dan的主页 Gavin_Dan | 初学一级 | 园豆:197
提问于:2017-04-10 15:40
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册