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

In This Topic
    SslOptions Property
    In This Topic
    Gets or sets Devart.Data.PgSql.SslOptions object which is used to establish secure connection with server.
    Syntax
    'Declaration
     
    Public Property SslOptions As SslOptions
    public SslOptions SslOptions {get; set;}

    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()
    See Also