EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SSL with Freepascal/lazarus

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#25554
Posted: 07/06/2013 06:43:46
by Gabrie Marcelo (Standard support level)
Joined: 07/06/2013
Posts: 16

Hi,
I'm developing a Windows app that needs to connect to websites that can be on https
I need to make simple request (HTTP/GET) to the website. I use lazarus/freepascal and actually I'm trying Synapse+OpenSSL but some client machines are throwing error 10091 which seems to be related to winsock.

My questions are:
1. Do you offer SSL component for lazarus/freepascal?
2. If yes, is there a eval version for downloading? What is the limitation of eval version?
3. Is your component coded to work with winsock? Should I expect to get the same error described above?
4. In the near future, I want to port the app to Linux and Mac. Does your component work with those platforms too?

I new with freepascal so apologies for my ignorance specially on this topic. thanks,
#25555
Posted: 07/06/2013 07:37:24
by Eugene Mayevski (EldoS Corp.)

Thank you for contacting us.

Quote
Gabrie Marcelo wrote:
1. Do you offer SSL component for lazarus/freepascal?


Yes, SecureBlackbox includes SSL/TLS component and SecureBlackbox can be used in FreePasal. Lazarus packages are included only in SecureBlackbox 11, which is in pre-release state at the moment, but you can reference FPC units directly.

Quote
Gabrie Marcelo wrote:
2. If yes, is there a eval version for downloading? What is the limitation of eval version?


Yes, on http://www.eldos.com/sbb/download-release.php (version 10) and http://www.eldos.com/sbb/download-prerelease.php (version 11 beta).

Evaluation version has speed delays and shows a nag screen from time to time.

Quote
Gabrie Marcelo wrote:
3. Is your component coded to work with winsock? Should I expect to get the same error described above?


I have yet to see a windows sockets application that works not via winsock. Considering that the error is about network failure, even something working not via winsock would not be able to deal with it.

In general, your code must be prepared for any networking errors. Relying on the components to provide you 100% guaranteed delivery is not what you can get in this reality. In other words, you must handle errors and provide graceful recovery mechanisms.

Quote
Gabrie Marcelo wrote:
4. In the near future, I want to port the app to Linux and Mac. Does your component work with those platforms too?


YEs, it does.


Sincerely yours
Eugene Mayevski
#25595
Posted: 07/09/2013 13:40:46
by Gabrie Marcelo (Standard support level)
Joined: 07/06/2013
Posts: 16

Hi Eugene,

I've downloaded v10 but need some help from you. This is the code I used with synapse tool. It basically create a http get to a URL that can be HTTP or HTTPS. I need to set proxy info. I need to get the response from the server, the http status code, and be able to inform of any error to the user. The code I have is this (for synapse tool)

with THTTPSend.Create do
begin

//Set proxy info???
ProxyHost := vProxyHost;
ProxyPort := ConfigFileManager('ProxyPort','');
ProxyUser := ConfigFileManager('ProxyUser','');
ProxyPass := ConfigFileManager('ProxyPass','');


if HTTPMethod('GET', url) then begin

ResultCode //The HTTP Code from the server

Document //A stream returned by the server

end else begin

//HOW TO HANDLER ERROR HERE?
//For example how to get error messages

end;

end;

May you "convert" it to use your solution instead? thanks,
#25596
Posted: 07/09/2013 15:47:43
by Gabrie Marcelo (Standard support level)
Joined: 07/06/2013
Posts: 16

ok. I tried the following code:

-------------
HttpsClient := TElHTTPSClient.Create(nil);
try
try
HttpsClient.Get(Edit1.Text);

finally
HttpsClient.Close(true);

end;
except
on E : Exception do
begin
showmessage('Exception: ' + E.Message);
end;
end;
-------------

and when trying to connect to a website on https I got this error

------------
[Window Title]
project1

[Content]
Exception: Certificate validation handler is not assigned. Please handle the OnCertificateValidate event and implement proper certificate validation code there.

[OK]
--------------

what does it mean?
#25597
Posted: 07/09/2013 16:01:30
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

Hi. You should call SetLicenseKey function from SBUtils with trial key. You can get the trial key and instructions how to use it in LicenseKey.txt which is included in SBB download.
#25598
Posted: 07/09/2013 16:23:53
by Gabrie Marcelo (Standard support level)
Joined: 07/06/2013
Posts: 16

Thanks Mykola. Yes, I figured it out and that's why I edited my last message. What can you say me about the error I'm getting when trying to connect to an https site:

-----------
Exception: Certificate validation handler is not assigned. Please handle the OnCertificateValidate event and implement proper certificate validation code there.
-----------

I'd appreciate any help on this matter. thanks,
#25599
Posted: 07/09/2013 16:31:22
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

It also say for itself - you should assign handler to event .OnCertificateValidate, and inside of this handler return true if you believe that this certificate is correct i.e. belongs to the site you are connecting to.
#25611
Posted: 07/10/2013 07:19:45
by Gabrie Marcelo (Standard support level)
Joined: 07/06/2013
Posts: 16

thanks for the help. I finally got it working. I'd like to purchase the product but have a doubt.

My need is to use your product to get data from http and https (SSL/TLS) from a client app (NOT a server) so I was thinking about purchasing a lic for SSLBlackbox Client only. In the my code, I'll use these units SBHTTPSClient, SBUtils, SBX509

Does the SSLBlackbox cover my needs?

And after I receive my license, I set it in the code but my question is... are you product validate/activate the license online? Hope it does not but I want to be sure. thanks,
#25612
Posted: 07/10/2013 07:23:49
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

Quote
I'll use these units SBHTTPSClient, SBUtils, SBX509

SBHTTPSClient is a part of HTTPBlackbox client package. It includes SSLBlackbox client package. You need HTTPBlackbox client to use this unit.

Quote
And after I receive my license, I set it in the code but my question is... are you product validate/activate the license online? Hope it does not but I want to be sure.

The license is not validated or activated online. You can even strip license validation if you have a source code.
#25613
Posted: 07/10/2013 08:31:56
by Gabrie Marcelo (Standard support level)
Joined: 07/06/2013
Posts: 16

So I have to purchase HTTPBlackbox Client package that will allow me to make request to http AND https, right? I mean, I do not need to buy SSLBlackbox as it is included into HTTPBlackbox?
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 3691 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!