-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
How do I run the migration with SSL enabled? #154
Comments
I have the same question, but I am using the config file. I added "ssl": true, but it still does not connect via SSL. |
+1 |
1 similar comment
+1 |
Hm I have a bit of hard times to answer this question, as I don't have an SSL enabled endpoint available. |
You can spin one up for free on Heroku. |
🆒 Will try to do that ASAP (which is probably one evening during this week) |
The SSL Heroku connection string looks something like:
The So back to
You'll notice that the database value that is being parsed includes the query parameter Digging in a little bit, I see that It seems like two things might help here:
Any thoughts? |
My PR has been merged, could you test if specifying dialectOptions will work for postgres? |
It is unfortunate that node's url.parse incorrectly ambiguates the path component with the query component, and thus does not conform to RFC3986 terminology [1]. As such, urlStringToConfigHash should apparently be using the [1] "The path is terminated by the first question mark ("?") or number sign ("#") character, or by the end of the URI." |
@gofish could you please give an example of how you solve this issue using |
@joshuakarjala You need to use a config file and specify "dialectOptions" with an "ssl" entry. Example: {
"url": "postgres://localhost/database",
"dialectOptions": {
"ssl": {
"ca": "path/to/ca.crt"
}
} The default config file is "config/config.json" (or config/config.js). Specify an alternative using --config . |
Got it to work by doing: {
"use_env_variable":"DB_CONNECTION_STRING",
"dialect":"postgres",
"ssl":true,
"dialectOptions":{
"ssl":{
"require":true
}
}
} Still would be much appreciated if |
This seems to be related, but has slightly different information https://github.com/sequelize/cli/tree/master/docs#dialect-specific-options |
Add List command to display a list of available exercises
hey @joshuakarjala I am going throw the same problem. I have created a file error_log: |
Thank you! I had an issue that the certificate was self-signed which was resolved by adding {
"use_env_variable":"DB_CONNECTION_STRING",
"dialect":"postgres",
"ssl":true,
"dialectOptions":{
"ssl":{
"require":true
"rejectUnauthorized": false
}
}
} 💡 Referrence: brianc/node-postgres#2009 (comment) |
For anyone else who comes across this issue and, despite setting the |
I'm trying to run a migration on a remote postgres host that requires SSL, passing
--url=...
on the command line. How do I enable SSL?The text was updated successfully, but these errors were encountered: