【问题标题】:Xamarin. X509Certificate and ClientBase赛马林。 X509Certificate 和 ClientBase
【发布时间】: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


【解决方案1】:

它必须作为依赖来完成,而不是通过 PCL,请参阅https://forums.xamarin.com/discussion/comment/271718#Comment_271718

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-03
    • 1970-01-01
    • 2019-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多