I use R on Windows to connect to a PostgreSQL database hosted on AWS. The database is configured using forcessl = 1 - this means that any connection must be configured using sslmode = require.
The base package RPostgreSQLdoes not provide any ssl options. This has repeatedly been raised as a problem (see here , here , here and here )
I know that there is a workaround using the package RPostgres, but for other reasons of functionality, I would prefer to use the package RPostgreSQL.
Several answers (e.g. here ) suggested using the modified dbname to connect to ssl as follows:
dbConnect(dbDriver('PostgreSQL'),
dbname = 'dbname=foobar sslmode=require',
host = 'foobar.rds.amazonaws.com',
port = 5439,
user = 'foobar',
password = 'foobar')
But this did not work for me using the CRAN version of the package. This led me to a recent issue raised in github RPostgreSQL: https://github.com/tomoakin/RPostgreSQL/issues/88
The original user was able to use the modified dbname method when he compiled the package from the source. On Windows, using the latest source package (0.6.2) compiled with RTools, I get the following error when I run the modified dbname code:
Error in postgresqlNewConnection(drv, ...) :
RS-DBI driver: (could not connect xxxxx.rds.amazonawss.com:5432 on dbname "xxxxxxx": sslmode value "require" invalid when SSL support is not compiled in
)
From this and the rest of the stream, it seems that SSL is not possible from the current source on both Windows and Mac. However, the developer offers:
, libssl libpq SSL, SSL.
, , , , , . . , ?