Skip to content

TLS caCertificates not working #506

Description

@jsb188

Describe the bug

Attempting to connect to database with these options fail with error: "The certificate used to secure the TLS connection is invalid: Bad resource ID"

tls: {
    enforce: true, // Set this to false if using localhost
    caCertificates: [await Deno.readTextFile('./pg-server-ca.pem')],
},

However, this simple connection test succeeds:

const conn = await Deno.connectTls({
    hostname: Deno.env.get('PG_HOST'),
    port: 5432,
    caCerts: [await Deno.readTextFile("pg-server-ca.pem")],
  });

To Reproduce
Try the code/steps above.

Expected behavior
PG should connect, but it does not.

Activity

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