dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / PgSqlConnection Class / SslOptions Property
Example

SslOptions Property
Gets or sets Devart.Data.PgSql.SslOptions object which is used to establish secure connection with server.
Syntax
'Declaration
 
Public Property SslOptions As SslOptions
 

Property Value

Devart.Data.PgSql.SslOptions object which is used to establish secure connection with server.
Remarks
You have to include "SSL=true" initialization parameter to ConnectionString to enable SSL data transfer.
Example
The following example shows how to enable SSL data transfer with dotConnect for PostgreSQL.
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()
Requirements

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

See Also