PostgreSQLDatabase.SSLCertificate

From Xojo Documentation

Property (As FolderItem )
aPostgreSQLDatabase.SSLCertificate = newFolderItemValue
or
FolderItemValue = aPostgreSQLDatabase.SSLCertificate

Supported for all project types and targets.

Specifies the file for the client SSL certificate, replacing the default ~/.postgresql/postgresql.crt. This parameter is ignored if an SSL connection is not made.

Examples

This example specifies that the connection should try to use SSL using the specified certificate:

Var certFile As New FolderItem("LocalPGCertfile.crt")

Var db As New PostgreSQLDatabase
db.Host = "192.168.1.172"
db.SSLMode = PostgreSQLDatabase.SSLAllow
db.SSLCertificate = certFile
db.Port = 5432
db.DatabaseName = "BaseballLeague"
db.UserName = "broberts"
db.Password = "streborb"
Try
db.Connect
// Use the database
Catch error As DatabaseException
MessageBox("Connection Failed: " + error.Message)
End Try


See Also

PostgreSQLDatabase.SSLKey, PostgreSQLDatabase.SSLMode