db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 361 forks source link

fix: Connection string with ssl broken for postgres #792

Closed alexchaaan closed 1 year ago

alexchaaan commented 2 years ago

Connection strings with ssl are sent as sslrootcert, sslcert, sslkey and will be parsed as

  config = {
    sslrootcert: rootcert,
    sslcert: cert,
    sslkey: key,

pg expects ssl configurations sent as

  ssl: {
    ca: rootCert,
    cert: cert,
    key: key,
  }

this change checks for ssl configs parsed from a connection string and changes it to the expected ssl object

wzrdtales commented 1 year ago

this would break several drivers. This is nothing to be fixed on core level but on the individual driver.

wzrdtales commented 1 year ago

i.e. postgres with the native pg driver would break, but also any other library that reads the files itself.