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

Cannot define SSL connection options for MongoDB in environment variables #1741

Closed
PRo25 opened this issue Mar 11, 2018 · 2 comments
Closed

Comments

@PRo25
Copy link

PRo25 commented Mar 11, 2018

Issue type:

[ ] question
[X] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[X] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] websql

TypeORM version:

[ ] latest
[ ] @next
[X] 0.1.11

Steps to reproduce or a small repository showing the problem:

It isn't possible to configure a connection to a MongoDB server that uses SSL by using the environment variables. I tried, without success, to use the variable "TYPEORM_DRIVER_EXTRA" by defining it in the ".env" file like this: "TYPEORM_DRIVER_EXTRA={ "ssl": true, "sslValidate": false }". But after checking the MongoDB driver code (https://github.com/typeorm/typeorm/blob/master/src/driver/mongodb/MongoDriver.ts) I noticed it doesn't use the extra property of the options object for anything so it's normal that it doesn't work.
If I configure the connection options with SSL directly in the code then it works fine.

@pleerock
Copy link
Member

Thank you for the report. PR will be accepted for this feature request.

@osdiab
Copy link
Contributor

osdiab commented Jan 12, 2019

I'm using postgres, but I believe my pr should fix this? #3409 at least for setting it to true. ah guess I'm wrong, didnt know about the DRIVER_EXTRA variable. good luck solving this

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

No branches or pull requests

3 participants