Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cert-based authentication broken #2392

Closed
gregallenvt opened this issue Oct 27, 2020 · 3 comments · Fixed by #2394
Closed

Cert-based authentication broken #2392

gregallenvt opened this issue Oct 27, 2020 · 3 comments · Fixed by #2394
Labels

Comments

@gregallenvt
Copy link

Starting yesterday with the upgrade to 8.4.2, connections now fail with the error message: error: connection requires a valid client certificate.

It appears that the switch to making the ssl key not enumerable means that the key is no longer copied because Object.assign() only works with enumerable properties.

This became much trickier to debug since the pg dependency on pg-pool allows for minor version upgrades. We downgraded to 7.17.0 to fix things for the short term.

Thanks

@Yonom
Copy link

Yonom commented Oct 28, 2020

We are also experiencing this same issue in two of our projects

@flo-sch
Copy link

flo-sch commented Nov 1, 2020

Almost lost my mind today with that 😅

I had upgraded several dependencies and could not figure out what the problem was before reverting my upgrades and re-trying each of them one by one.

Sticking to pg 8.4.1 works for me at the moment, using it with knex:

const configuration = {
  client: 'pg',
  connection: {
    database: process.env.DATABASE_NAME,
    host: process.env.DATABASE_HOST,
    port: parseInt(process.env.DATABASE_PORT || '5432'),
    user: process.env.DATABASE_USERNAME,
    password: process.env.DATABASE_PASSWORD,
    ssl:
      process.env.DATABASE_SSL_CERT && process.env.DATABASE_SSL_KEY
        ? {
            host: process.env.DATABASE_SSL_HOST,
            ca: process.env.DATABASE_SSL_CA
              ? fs.readFileSync(process.env.DATABASE_SSL_CA)
              : undefined,
            cert: fs.readFileSync(process.env.DATABASE_SSL_CERT),
            key: fs.readFileSync(process.env.DATABASE_SSL_KEY)
          }
        : false
  }
};

@brianc
Copy link
Owner

brianc commented Nov 2, 2020

baaaah sorry about that breakage! 😦 😦 😦 Looks like charmander is already working on a fix for it, which is rad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants