PostgreSQLDatabase.SSLKey

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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

Supported for all project types and targets.

Specifies the location for the secret key used for the client certificate. It can specify a file that will be used instead of the default ~/.postgresql/postgresql.key file.

Examples

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

Var db As New PostgreSQLDatabase
db.Host = "192.168.1.172"
db.SSLMode = PostgreSQLDatabase.SSLAllow
db.SSLCertificate = New FolderItem("LocalPGCertfile.crt")
db.SSLKey = New FolderItem("LocalKeyFile.key")
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.SSLCertificate, PostgreSQLDatabase.SSLMode