I'm working on an application using c#-4.0 and EntireX Broker 9.5.1 I'm attempting to convert to tpcip connections to use ssl. I was successful in upgrading my java code to do the same thing thanks to Java/ Software AGs use of jsse for handling the SSL/ceritificate validation. However, when connecting to the same server/port under .net I'm getting the following error:
02150403: Certificate expired or invalid
The error message sounds like it's communicating. So how can I get .Net to successfully validate the certificate?
PS: The certificate is signed by Verisign.
UPDATE:
Both IE and Firefox successfully connect on https://server.domain:port
without throwing certificate errors. My application is actually connecting to ssl://server:port?verify_server=y
verify_server=n
throws the same certificate error.
The certificate is not expired. The stack trace from the exception stops right at Broker.Logon();
.
at SoftwareAG.EntireX.NETWrapper.Runtime.Broker.Logon(String password)
at FAServer.EntireXDotNetClasses.EntireXWrapper.CreateBroker() in C:\Users\tfburton\Documents\Visual Studio 2010\Projects\NEW FADCOM\FAServer\EntireXDotNetClasses\EntireXWrapper.cs:line 1302
UPDATE:
Here's how I'm creating my Broker object.
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
}
Turns out I was barking up the wrong tree.
I'm not sure if .NET has an equivalent for JSSE.
My solution turned out to be a lot simpler, concatinate the root certs in a text file and add
trust_store=path\to\file\myrrootcerts.pem
as a parameter to the url aka
BROKER-ID