为什么无法建立具有权限的SSL / TLS安全通道的信任关系?

时间:2017-10-16 09:50:29

标签: c# wcf ssl

我使用C#.NET开发了一个Windows服务,并从我的Windows服务调用了一个Java Web服务。 Web服务受证书保护,因此我的客户已向我提供了证书。我已使用MMC.EXE将证书安装到Root,Personal和Trusted People部分,但在尝试与其API通信时出现以下错误。

  

无法与权限'pmtest.xxxxxx.ua:9192'建立SSL / TLS安全通道的信任关系。   内部异常:根据验证程序,远程证书无效。

以下是我在其网络服务中调用该方法的代码。

  try
   {
      System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate { return true; };
     resp = (EBMType)wsClient.InvokeMember(this.remoteMethodName, BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public, null, this.privatMoney, new object[] { this.requestObject }); //Here I'm getting error
    }
  catch (System.Reflection.TargetInvocationException e)
    {
              System.ServiceModel.FaultException<FaultType> ex = (System.ServiceModel.FaultException<FaultType>)e.InnerException;
                    throw new ApplicationException(string.Format("PrivatMoney error occurred. Message: {0}, Code: {1}", ex.Detail.FaultNotification.FaultMessage.Text, ex.Detail.FaultNotification.FaultMessage.Code));
     }

我可以知道在这种情况下该怎么做,因为我在这个领域很新。提前谢谢。

0 个答案:

没有答案
相关问题