I am running a Postgres-9.4 server, for which I would like to use SSL. When I connect to the Postgres server from my laptop using the pgadmin or windows odbc connection, it works with SSL. However, when I try to connect to R using SSL, it fails.
library(RPostgreSQL)
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv,
user = "postgres",
password = mypasswd,
dbname = "dbname=postgres sslmode=prefer",
host = "192.168.1.179")
If I set my pg_hba.conf to allow connections other than ssl, then this will work. When I set it up only for allowed SSL connections, it will crash. Unfortunately, dbConnectit has no option verbose, so I get nothing more thancould not connect postgres@192.168.1.179 on dbname "postgres"
I found this question , which seems to suggest that I am doing the right thing, but don't leave.
Edit:
I did a few more digging and found this discussion which suggests that this will not work on Windows due to various library / dll issues. This discussion was a few years ago, so it may have been resolved. I can confirm that doing the above from linux really works.
source
share