This class is used in conjunction with PgSqlConnection to establish secure connection.
The following files are required for SSL encryption:
For more information on client side configuration you can visit OpenSSL site at http://openssl.org/. For information on SSL support in PostgreSQL server, refer to the PostgreSQL documentation topic Secure TCP/IP Connections with SSL.
PgSqlConnection conn = new PgSqlConnection("user id=postgres;password=postgres;host=localhost;"); conn.SslOptions.CACert = "E:\\Test\\root.crt"; conn.SslOptions.Cert = "E:\\Test\\client.crt"; conn.SslOptions.Key = "E:\\Test\\client.key"; conn.SslOptions.SslMode = SslMode.Require; conn.Open();
Dim conn As PgSqlConnection = New PgSqlConnection("user id=postgres;password=postgres;host=localhost;") conn.SslOptions.CACert = "E:\Test\root.crt" conn.SslOptions.Cert = "E:\Test\client.crt" conn.SslOptions.Key = "E:\Test\client.key" conn.SslOptions.SslMode = SslMode.Require conn.Open()
System.Object
Devart.Data.PostgreSql.SslOptions
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2