xamarin.ios httpclient clientcertificate不使用https

时间:2017-08-03 12:31:00

标签: xamarin.ios httpclient

我有一个只允许https和ssl请求的网络服务。 1& 1为我们提供了Geo Trust的证书。 (.PFX)

在Android中,我的https请求正在使用证书。 它看起来像这样:

df['New time'] = pd.to_timedelta(df['start_time']) + 
                 pd.to_timedelta(df['Duration(seconds)'], unit='s')
df['New time'] = pd.to_datetime(df['New time']).dt.strftime('%H:%M:%S')
print (df)
  Serial start_date start_time  Duration(seconds)  New time
0      A  5/22/2017   10:37:24                216  10:41:00
1      A  5/22/2017   10:37:26             213000  21:47:26
2      A  5/22/2017   10:37:29                  3  10:37:32
3      A  5/22/2017   10:39:55                 60  10:40:55
4      A  5/22/2017   10:51:50                380  10:58:10
5      A  5/22/2017   10:51:57                339  10:57:36

但在iOS中它不起作用。 继承人守则

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Ssl3;

        using (var mmstream = new MemoryStream())
        {
            Android.App.Application.Context.Assets.Open("***.pfx").CopyTo(mmstream);
            byte[] b = mmstream.ToArray();

            X509Certificate2 cert = new X509Certificate2(b, "'''", X509KeyStorageFlags.DefaultKeySet);
            clientHandler.ClientCertificates.Add(cert);
        }


        ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) => { return true; });

我总是收到错误消息Methode没有实现。 (行clienthandler.clientcertificated.add(cert);)。

我做错了什么?

0 个答案:

没有答案