[Heroku Postgres] Self Signed Certificate Issue
bfg-coding opened this issue · 3 comments
bfg-coding commented
Running into an issue where I can't run the generator because of this certificate issue. On the NestJS TypeORM module I can pass the argument rejectUnauthorized: false
which bypasses this error can I do something similar for the generator?
typeorm-model-generator@0.4.3
[11:07:59 AM] Starting creation of model classes.
Error connecting to Postgres Server.
Error occurred in typeorm-model-generator.
typeorm-model-generator@0.4.3 node@v12.13.0
If you think this is a bug please open an issue including this log on https://github.com/Kononnable/typeorm-model-generator/issues
self signed certificate
(node:15772) UnhandledPromiseRejectionWarning: Error: self signed certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
at TLSSocket.emit (events.js:210:5)
at TLSSocket._finishInit (_tls_wrap.js:794:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12)
(node:15772) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15772) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Kononnable commented
Sorry for the delay.
For now I would suggest modifying code locally.
I think it would be good to allow passing custom options to drivers, but it needs to be designed properly.
josephfinlayson commented
Set NODE_TLS_REJECT_UNAUTHORIZED=0
before running typeorm
jgb-solutions commented
@josephfinlayson hey, thanks! I got this stuff working finally. But I still think that's too much. shouldn't have to do that. But it's working so that's good.