什么是.NET(C#)的JSSE等价物?

时间:2014-03-17 23:58:43

标签: c# java ssl jsse webmethods

我正在使用 EntireX Broker 9.5.1 处理应用程序我尝试转换为tpcip连接以使用ssl。由于Java / Software AG使用来处理SSL /证书验证,我成功地升级了我的代码以执行相同的操作。但是,当连接到下的同一服务器/端口时,我收到以下错误:
02150403: Certificate expired or invalid

错误消息听起来像是在进行通信。那么如何让.Net成功验证证书呢?

PS:证书由Verisign签署。

更新
IE和Firefox都在https://server.domain:port上成功连接,而不会丢失证书错误。我的申请实际上已连接到ssl://server:port?verify_server=y verify_server=n会抛出相同的证书错误。

证书未过期。来自异常的堆栈跟踪在Broker.Logon();处停止。

  

在SoftwareAG.EntireX.NETWrapper.Runtime.Broker.Logon(String password)
  at FAServer.EntireXDotNetClasses.EntireXWrapper.CreateBroker()在C:\ Users \ tfburton \ Documents \ Visual Studio 2010 \ Projects \ NEW FADCOM \ FAServer \ EntireXDotNetClasses \ EntireXWrapper.cs:line 1302

更新
这是我如何创建我的Broker对象。

try
{
  Broker mybroker;
  try { mybroker = new Broker(BrokerName, BrokerUser); }
  catch (Exception e)
  {
     Utilities.LogEntry("Error Creating broker instance -- BEFORE LOGON. ", e, true);

     throw new WrapperException("Error Creating broker instance -- BEFORE LOGON. "
                               + Environment.NewLine + e.Message);
  }
  try //{ mybroker.Logon(BrokerPass); }
  {
     mybroker.Password = BrokerPass;
     mybroker.Logon();  //<-- stracktrace points here
  }
  catch (AccessViolationException ave)
  {
     Utilities.LogEntry("Error During Broker Logon.", ave, 
                        EventLogEntryType.Error);

     throw new WrapperException(ave); //wrap and duck
  }
}
catch ( Exception e )
{   
   Utilities.LogEntry("Error Creating broker instance. ", e, true);

   XException be = e as XException; 
   if ( null != be  ) //<-- resolves to true
   {
      String msg = "Certificate error connecting to: " + BrokerName;

      throw new WrapperException(msg, e);
   }
   throw new WrapperException( "Error Creating broker instance. " 
                             + Environment.NewLine + e.Message);  //<-- error caught and re-thrown here

}

1 个答案:

答案 0 :(得分:1)

原来我正在咆哮着错误的树。

我不确定.NET是否具有JSSE的等价物。

我的解决方案变得更简单,在文本文件中合并根证书并添加

trust_store=path\to\file\myrrootcerts.pem

作为url又名

的参数
BROKER-ID