SSL Connection - PostgreSQL

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
diogodias
Posts: 1
Joined: Tue 21 Jun 2016 18:57

SSL Connection - PostgreSQL

Post by diogodias » Tue 21 Jun 2016 19:19

Hi,

i have a app that suports a SLL connection with postgres and it works.
I would like to know if there another way to pass the client certificate. Currently i pass the path of the client certificates(client.crt, root.crt and client.key) to the TUniconnection, via
TUniconnection.SpecificOptions.Values['SSLCert'] ...

But i need another way to reference the certificates, for example, via Windows Certificate Store.
Because the certificate files path its not allowed to access by the user. Its a company politics.

Any ideia?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SSL Connection - PostgreSQL

Post by ViktorV » Tue 01 Nov 2016 14:15

To solve your issue, you can use Unidac with the Securebridge components. You can get information about the connection to the PostgreSQL server, using SSL, in our documentation: https://www.devart.com/pgdac/docs/?secu ... ctions.htm
Also you can explore our demo projects, demonstrating usage of sharing Unidac and securebridge components: %UniDACDemos%\TechnologySpecific\securebridge, where %UniDACDemos% is by installing Unidac demo projects on your computer.
To work with the certificates stored in the Windows certificate store, you should use the TScCryptoAPIStorage component: https://www.devart.com/sbridge/docs/ind ... icates.htm
To retrieve the list of certificates, you can execute the TScCryptoAPIStorage.Certificates.GetCertificateNames method. For example:

Code: Select all

  ScCryptoAPIStorage.CertProviderType := ptSystem;
  ScCryptoAPIStorage.Certificates.GetCertificateNames(Memo.Lines); // Memo is a TMemo component

Post Reply