【问题标题】:Accessing Securised Web Service访问安全的 Web 服务
【发布时间】:2010-04-30 07:53:42
【问题描述】:

我需要使用 Windows 窗体应用程序连接到提供商的 Web 服务。他给了我一个访问它的证书,但我有一个安全问题。

我已经完成了以下步骤:

  1. 将证书添加到个人商店(在 IE 和 Firefox 上)
  2. 使用远程 wsdl 生成代理(没问题)
  3. 使用此代码调用方法:

    `使用 (service1.MessagesService m = new service1.MessagesService()) {

    X509Certificate crt = new X509Certificate(@"C:\OpenSSL\bin\thecert.p12",string.Empty);
    m.ClientCertificates.Add(crt);
    var 结果 = m.AuthoriseTransaction(aut);

    this.textBox1.AppendText(result.id.ToString());
    }`

我有以下错误:
底层连接已关闭:无法为通道 SSL/TLS 建立信任关系。

感谢您的帮助

【问题讨论】:

    标签: c# .net winforms web-services https


    【解决方案1】:

    您的连接未正确授权,网络服务是否通过 https?您可能需要创建CertificatePolicy 的自定义实现。有关示例,请参阅此 article

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-11
      • 1970-01-01
      • 1970-01-01
      • 2010-09-08
      • 2012-03-13
      • 2013-11-04
      • 1970-01-01
      • 2013-04-08
      相关资源
      最近更新 更多