Giving the content of ca.pem file as hard coded string in delphi for SSL connection

445 Views Asked by At

I have a MySQL server and I have the client certificate and keys for SSL connection to the MYSQL server. In delphi that uses MyDAC for connecting to mysql, I can use:

MySQL1Connection.SSLOptions.CACert := 'file location'
MySQL1Connection.SSLOptions.Cert := 'file location'
MySQL1Connection.SSLOptions.Key := 'file location'
MySQL1Connection.SSLOptions.ChipherList := 'All';
MySQL1Connection.Options.Protocol := mpSSL;

But the problem in the above application is that, I have to supply the files to the client. Now, I want to hardcode the content of the file in the .exe, such that I will not have to deliver the files to the client.

Do you know any cleaver way to do this?

1

There are 1 best solutions below

0
On

I have solved the problem by using the TScFileStorage component of secure bridge components (https://www.devart.com/sbridge/components.html)

The steps are available in the the section 3. of this link: https://www.devart.com/mydac/docs/?secureconnections.htm