Connecting to a DB that requires SSL using Delphi 7
Posted: Fri 06 Feb 2015 12:35
Hi,
We are having trouble to connect to a Postgres 9.2 database that only accepts SSL connections. If I read the documentation correctly this isn't possible using Delphi 7, but please correct me if I am wrong! Making a connection to this database using your Delphi 2007 driver is not a problem, it's only in Delphi 7 that we cannot connect.
Error message was something like "invalid username/password" (our DB admin changes our server settings so I cannot check anymore). Can you tell me please if I missed a connection property that I should set?
Another question: using Delphi 2007 with SSLMode parameter set to REQUIRE, I can connect to a database that only has the host property set (and not the sslhost). Shouldn't this be impossible?
Thanks in advance!
Martin de Haij
Below is the relevant text from the readme.html that's included with the driver installation:
SSLMode
This option determines whether or with what priority an SSL connection will be negotiated with the server. There are four modes:
Value Meaning
DISABLE Only an unencrypted SSL connection will be attempted.
ALLOW Negotiates trying first a non-SSL connection, then if that fails, tries an SSL connection.
PREFER Negotiates trying first an SSL connection, then if that fails, tries a regular non-SSL connection.
REQUIRE Tries only an SSL connection.
If PostgreSQL is compiled without SSL support, using option REQUIRE will cause an error, while options ALLOW and PREFER will be accepted but PgDAC will not in fact attempt an SSL connection.
It is available for Delphi 2007 and higher IDE versions.
SQLConnection1.Params.Values['SSLMode'] := 'REQUIRE';
We are having trouble to connect to a Postgres 9.2 database that only accepts SSL connections. If I read the documentation correctly this isn't possible using Delphi 7, but please correct me if I am wrong! Making a connection to this database using your Delphi 2007 driver is not a problem, it's only in Delphi 7 that we cannot connect.
Error message was something like "invalid username/password" (our DB admin changes our server settings so I cannot check anymore). Can you tell me please if I missed a connection property that I should set?
Another question: using Delphi 2007 with SSLMode parameter set to REQUIRE, I can connect to a database that only has the host property set (and not the sslhost). Shouldn't this be impossible?
Thanks in advance!
Martin de Haij
Below is the relevant text from the readme.html that's included with the driver installation:
SSLMode
This option determines whether or with what priority an SSL connection will be negotiated with the server. There are four modes:
Value Meaning
DISABLE Only an unencrypted SSL connection will be attempted.
ALLOW Negotiates trying first a non-SSL connection, then if that fails, tries an SSL connection.
PREFER Negotiates trying first an SSL connection, then if that fails, tries a regular non-SSL connection.
REQUIRE Tries only an SSL connection.
If PostgreSQL is compiled without SSL support, using option REQUIRE will cause an error, while options ALLOW and PREFER will be accepted but PgDAC will not in fact attempt an SSL connection.
It is available for Delphi 2007 and higher IDE versions.
SQLConnection1.Params.Values['SSLMode'] := 'REQUIRE';