-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support SSL-secured MySQL database connectivity #1385
Comments
+1 to this - would definitely appreciate a native way to do MySQL TLS connections from BookStack. Here is how our BookStack is setup to use TLS to our Mariadb server: In
You can also use |
Anyone know about this? I've tried this option from @tomaskir but seems like bookstack is ignoring it. I even add error to that database file and keep getting the SSL error. Any clue on what to do? |
Ok guys! for anyone having the same problem. You have to refresh laravels cacheeeeee OMG!
|
Is there any update on this issue? I modified
Then I cleared the cache by issuing: When I run
I am running Bookstack v21.10.2 on Ubuntu 20.04. |
I have the same error. Do you have the solution? |
You're missing some PDO attributes. PDO::MYSQL_ATTR_SSL_KEY=>'/certs/client-key.pem',
PDO::MYSQL_ATTR_SSL_CERT=>'/certs/client-cert.pem', It could be supported out of the box by creating a bool DB_SSL_CONNECTION variable in the .env, and common pdo ssl attributes. |
Just spent a while looking into this after being asked in the BookStack discord. From my testing, SSL usage is technically currently possible within BookStack using the below MYSQL_ATTR_SSL_CA="/path/to/server-cert.pem" This sets the The below are assumptions from spending hours testing and tweaking variables. There seems to be a lack of information out there regarding how PHP, PDO, MySQL & SSL entwine. In addition, the errors thrown in failure scenarios, at least with MariaDB, don't provide any information at all as far as I could see. Setting the above also seems to set the following default option: PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true From the MySQL docs:
This means that the MySQL server certificate must be using a Upon the above, using Copy of notes based upon past comments here:
If any additional options are definitely required feel free to explain the reason why, but I would like some insight into why they would be needed since I'll need to understand the usage when maintaining/testing things. Upon that, I'd want to know that an option is needed rather than it being added just because it made things work in one instance. |
The use of |
@Julesdevops Sure. Just to confirm my comment above was not in response to you previous comment at all. I was just looking to provide any clarification I can offer regarding existing settings based on my findings. I'm sure there are requirements for other settings but I'd want confirmation of requirement with explanation of use-base before expanding out our remit of support. Your exactly right in that we should add documentation for this option, if the current option is enough for most use-cases. |
@ssddanbrown Thank you so so much. I have resolved my issue by removing condition in this code
to
Again, I'm very pleased with your help |
If I understand the above correctly, there is currently no way to enforce SSL but ignore validation of the certificate? I am trying to deploy BookStack as a DigitalOcean App usin the LinuxServer.io container. In order to use the managed database service of DigitalOcean, we apparently cannot validate the certificate. |
@MaartenUreel It really depends on many factors tbh, this is a messy area, with mulitple layers of "validation" and many different configuration and options involved. You might be able to enforce SSL at a MySQL-user level, can't remember how certs and validation interplay there. Have you tried using a the DigitalOcean CA cert? Note: I remember some other users reporting issues about indexes using Digital Ocean hosted MySQL service. Might have been the kind of thing they had to connect support or something to make compatible. Can't remember the detail. |
Hey @ssddanbrown; apparently it is not required although it does looks like it in the console. I was able to connect without SSL and indeed I also had to arrange the index setting to allow creation of records without primary keys. I managed to get it up and running on DO with their managed database and using Spaces as storage layer. |
Describe the feature you'd like
If I understand correctly, database connectivity between BookStack and the MySQL database server is currently not SSL encrypted. This could be supported to enable more security and more use cases. Possibly, the underlying database provider/library already supports it.
Describe the benefits this feature would bring to BookStack users
Allows for more usage scenarios. What might be relevant, the default connection security settings for Azure's MySQL database service offering enforces SSL connection security. Thus I had to disable this to allow BookStack using the database.
The text was updated successfully, but these errors were encountered: