Skip to content

TLS caCertificates not working #506

@jsb188

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.

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