我正在使用c#-4.0和EntireX Broker 9.5.1开发应用程序我正在尝试转换为 tpcip 连接以使用 ssl。由于 Java/Software AG 使用jsse来处理 SSL/证书验证,我成功地升级了我的java代码来做同样的事情。但是,当连接到.net下的同一服务器/端口时,出现以下错误:
02150403: Certificate expired or invalid
错误消息听起来像是在交流。那么如何让 .Net 成功验证证书呢?
PS: 证书由威瑞信签名。
更新:
IE 和 Firefox 都成功连接https://server.domain:port
而不会引发证书错误。我的应用程序实际上正在连接到ssl://server:port?verify_server=y
verify_server=n
抛出相同的证书错误。
证书未过期。异常的堆栈跟踪在Broker.Logon();
.
在 SoftwareAG.EntireX.NETWrapper.Runtime.Broker.Logon(字符串密码)
在 C:\Users\tfburton\Documents\Visual Studio 2010\Projects\NEW FADCOM\FAServer\EntireXDotNetClasses\EntireXWrapper 的 FAServer.EntireXDotNetClasses.EntireXWrapper.CreateBroker() .cs:第 1302 行
更新:
这是我创建代理对象的方式。
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
}