EldoS | Feel safer!

Software components for data protection, secure storage and transfer

BlackBox Sample code usage

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#26979
Posted: 10/24/2013 06:08:59
by Jamie Taylor (Basic support level)
Joined: 10/24/2013
Posts: 17

I'm having trouble with some of the sample code that is provided in the trial version of BlackBox.

I'm looking to use BlackBox to create some TLS1.2 web server and client applications. I have:

  • Created a self-signed, test certificate (using SHA256 with RSA with a key length of 1024) using the CertDemo sample code
  • Given the outputted .pem file to the HTTPServer sample code
  • Pointed the HTTPServer sample code to a directory containing an index.html
  • Started a server on port 443 using TLS

However, when I attempt to perform a GET on the index.html with the HTTPGet sample code (set to HTTPS with port number 443), I constantly get error code 73730. This happens when I am hosting both the client and server locally, and when I am only hosting the client locally (the server is hosted on a colleague's machine in this instance)

I'm using the C# sample code projects, and Visual Studio 2008 to compile and run them. Do you have any ideas relating to the source or fix of the issue that I am facing with the sample code and self-signed certificate?
#26980
Posted: 10/24/2013 06:26:49
by Eugene Mayevski (EldoS Corp.)

Thank you for the report.

I've moved the topic to HelpDesk for checking.


Sincerely yours
Eugene Mayevski
#26981
Posted: 10/24/2013 06:27:48
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Please try to save your certificate as a PFX file and then use it with server instead of PEM.
#26983
Posted: 10/24/2013 07:30:38
by Jamie Taylor (Basic support level)
Joined: 10/24/2013
Posts: 17

Quote
Vsevolod Ievgiienko wrote:
Please try to save your certificate as a PFX file and then use it with server instead of PEM.


The reason I chose to output as PEM was because the server sample code wanted a PEM and I didn't want to change the sample code without first understanding how it worked. I will give this a try, if there are no other suggestions.
#26984
Posted: 10/24/2013 07:35:14
by Vsevolod Ievgiienko (EldoS Corp.)

Do you use the latest SecureBlackbox version? I don't see any place in the sample where PEM is required.
#26985
Posted: 10/24/2013 07:39:19
by Jamie Taylor (Basic support level)
Joined: 10/24/2013
Posts: 17

Quote
Vsevolod Ievgiienko wrote:
Do you use the latest SecureBlackbox version? I don't see any place in the sample where PEM is required.


I downloaded the installer yesterday. I will try exporting the certificate as PFX now.
#26986
Posted: 10/24/2013 07:43:47
by Jamie Taylor (Basic support level)
Joined: 10/24/2013
Posts: 17

Update:

This time I get the following message when I try to perform a get using the HTTPGet sample code:

"There was a problem validating the server certificate (validity: cvInvalid, reason: 512). Click OK to continue or Cancel to close the session."

Any ideas?
#26987
Posted: 10/24/2013 07:49:11
by Vsevolod Ievgiienko (EldoS Corp.)

Please modify HTTPSClient_OnCertificateValidate method from GetMain.cs file of HTTPGet sample next way:

Code
private void HTTPSClient_OnCertificateValidate(object Sender, SBX509.TElX509Certificate X509Certificate, ref bool Validate)
{
   Validate = true;
}


The problem is that the sample tries to perform server certificate validation and its not valid according to PKI as its self-signed.
#26990
Posted: 10/24/2013 07:55:10
by Jamie Taylor (Basic support level)
Joined: 10/24/2013
Posts: 17

Quote
Vsevolod Ievgiienko wrote:
The problem is that the sample tries to perform server certificate validation and its not valid according to PKI as its self-signed.


This solved the issue. Thank you very much.
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 1292 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!