typeorm-model-generator icon indicating copy to clipboard operation
typeorm-model-generator copied to clipboard

[Heroku Postgres] Self Signed Certificate Issue

Open bfg-coding opened this issue 5 years ago • 3 comments

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?

[email protected]
[11:07:59 AM] Starting creation of model classes.
Error connecting to Postgres Server.
Error occurred in typeorm-model-generator.
[email protected]  [email protected]
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.

bfg-coding avatar Oct 13 '20 17:10 bfg-coding

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.

Kononnable avatar Oct 31 '20 23:10 Kononnable

Set NODE_TLS_REJECT_UNAUTHORIZED=0 before running typeorm

josephfinlayson avatar Nov 07 '20 21:11 josephfinlayson

@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.

jgb-solutions avatar Apr 12 '22 23:04 jgb-solutions