-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
"Unknown SSL profile" for self-host using MySQL with SSL after mysql2 package update (v4.38+) #14635
Comments
@stefann42 I can't seem to reproduce it from your config example. If I replace the smart quotes with double quotes, it functions as expected (ie. it errors because I don't provide the CA certificate). Both our Can you have a look again and check the config you see breaking your site? Also note the SSL docs |
Note from our bot: The |
Looks like we were using an outdated information, thanks for the pointer to Ghost's SSL docs. That said, serializing the CA public cert as a config parameter is awfully complicated. Do you happen to have a sample config for when you're Ok to ignore SSL cert validation? Unfortunately the node-mysql2 docs have a placeholder where the "SSL" examples are supposed to go. |
Nevermind, after some trial and error this seems to work |
Hey, I realise this was annoying to figure out but it seems the upshot is, mysql2 is really picky about configuration, and was throwing an error because of the If you are using SSL but are ok to skip certificate validation, you only need I'm a little dubious about updating our own docs to cover this, as I'm not clear on what the use case would be for requiring an SSL config but not validating the cert 😬 Going to close as there is no bug - but convo can continue and if we decide we do want to update docs that's very quick! |
@ErisDS There are many cases where it's warranted to use SSL but not validate the cert. Local development for example or if you must encrypt traffic but it's too costly/time consuming to maintain valid certificates for your own infrastructure. Sometimes you just need to get something up and running quickly. IMHO the purpose of documentation is to be helpful not judgmental. Right now self-host docs cover a narrow set of use cases (deploying db on AWS RDBMS). To be helpful give developers the information and trust that they know what they're doing if choose to do something. I opened this issue because we wasted two full days with this issue and we don't want other people to have the same experience. |
Hi @ErisDS, having the same problem. Fresh installation, trying to connect Azure MySQL managed service (v8). Please see my config below:
` |
Issue Summary
Prior to this change bf6f607 self-hosters who connect to MySQL 5.7 using SSL were able to use this config as as discussed at https://forum.ghost.org/t/configure-mysql-over-tls-ssl/2297/8
Upgrading past v4.37 breaks Ghost (node app cannot start) with the error
Unknown SSL profile "{ 'rejectUnauthorized':'true', 'secureProtocol':'TLSv1_2_method'}"
We need to understand what's the correct SSL config for mysql2 library. This is possibly an issue for downstream dependencies.
Relevant code from downstream dependencies:
https://github.com/sidorares/node-mysql2/blob/d74558b605162156b813248a024f7559785de6fb/lib/connection_config.js#L119
Steps to Reproduce
Ghost Version
Node.js Version
14.x
How did you install Ghost?
Using instructions at https://ghost.org/docs/hosting/
Database type
MySQL 5.7
Browser & OS version
No response
Relevant log / error output
Code of Conduct
The text was updated successfully, but these errors were encountered: