web3-storage / web3.storage

DEPRECATED ⁂ The simple file storage service for IPFS & Filecoin
https://web3.storage
Other
502 stars 121 forks source link

Review use of NODE_TLS_REJECT_UNAUTHORIZED for postgres connections #1451

Open adamalton opened 2 years ago

adamalton commented 2 years ago

Currently, in packages/cron/package.json we're using NODE_TLS_REJECT_UNAUTHORIZED to work around an SSL problem with the direct postgres (not postgREST) connection to the DB, which is hosted on Heroku. If we remove this flag then we get this:

Error: self signed certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket._finishInit (node:_tls_wrap:946:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12) {
  code: 'DEPTH_ZERO_SELF_SIGNED_CERT'

So it appears that our connection to Heroku is using SSL, but Heroku is supplying a self-signed certificate.

The question is: are we ok with bypassing this security check?

My thoughts are:

dchoi27 commented 2 years ago

@vasco-santos thoughts here?