Unanswered: Trouble with UniBasic and digital certificates
I have a task at work to send a secure internet request to a particular credit reporting agency and receive and parse the response. We use UniData as our database and UniBasic as the programming language.
I've gotten it to work using the following UniBasic commands:
One of their requirements is that I validate the connection using their certificate. I've obtained their server certificate file and made it available to these commands. However, I'm new to the world of digital certificates. When I change the commands to the following, I get CMD.STATUS = 3 (Network error) returned from the submitRequest() command.
Thanks to some help from IBM Tech Support, here is what I've discovered to be my problem--and the solution.
The credit agency server has a series of three certificates in its chain and sends them all during the SSL handshaking. I was only adding the last one in the chain to my secure context when I should have been adding either just the first one or all three.
The certificate chain sent by the credit agency's server included the self-signed certificate issued by VeriSign (the top level cert). But I didn't have that certificate included in my context so it couldn't verify it--thus generating the error "self signed certificate in certificate chain". As soon as I added that certificate to my context everything worked great.