【发布时间】:2014-08-11 00:39:58
【问题描述】:
我正在开发与 Web 服务一起使用的 xamarin 应用程序。
Xamarin 是否支持 System.ServiceModel.ClientBase 中的 X509Certificate?
在使用 .Net 4.5 构建的项目中工作的下一个代码:
public void Initialize()
{
var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
var endpoint = new EndpointAddress("https://ThereIsMyServerAddress/PathToService");
_mobileService = new ServiceClient(binding, endpoint);
_mobileService.ClientCredentials.ClientCertificate.Certificate = new X509Certificate2("Ivanov_Ivan_Ivanovich.cer");
}
但 Xamarin 在 ClientCredentials 中看不到 ClientCertificate.Certificate。
有没有办法给ServiceClient添加证书?
【问题讨论】:
-
使用证书重要吗?你可以忽略它。
标签: c# wcf xamarin x509certificate2