Skip to content

I'm trying to connect to a Neon DB hosted behind a Replit deployment, result: "Error:" #476

Open

Description

@genobobeno

I don't know how to produce a reprex without username and password...

I'm running the code below, and it's outputting the word "Error:"
No explanation.

Version 1.4.7

conn <- dbConnect(Postgres()
+                   , host=myhost
+                   , port=5432
+                   , dbname='neondb'
+                   , user='neondb_owner'
+                   , password=pw)
Error:

When I tried using PostgreSQL(), I got the error:
"RPosgreSQL error: could not connect neondb_owner@myhost:5432 on dbname "neondb": ERROR: connection is insecure (try using sslmode=require)"

This kept happening no matter how I attempted to manage the sslmode issue. Which is why I tried Postgres()

Activity

  1. krlmlr commented on Dec 3, 2024

    @krlmlr
    Member

    Thanks, this is helpful.

    Can you connect through the psql command line application? With what switches?

  2. genobobeno commented on Dec 4, 2024

    @genobobeno
    Author

    psql "host=myhost dbname=neondb user=neondb_owner password=pw sslmode=require sslrootcert=C:\path\to\my\cert\isrgrootx1.pem"

    This connected

  3. krlmlr commented on Dec 11, 2024

    @krlmlr
    Member

    Thanks.

    https://rpostgres.r-dbi.org/reference/Postgres.html#arg-- describes (somewhat hidden) the additional arguments to dbConnect() , and points to https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS . From what I can tell, a variant like the following might work:

    dbConnect(..., sslmode = "require", sslrootcert = r"(C:\...)")

    Do we need to improve our documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions