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

Fix: moved ssl_mode parameter for mysql backend engine #5771

Merged
merged 1 commit into from Feb 15, 2024

Conversation

MaciejSzczurek
Copy link
Contributor

@MaciejSzczurek MaciejSzczurek commented Feb 15, 2024

Proposed change

The introduced change corrects a bug in which the ssl_mode parameter was not taken into account by the MySQLdb engine. The ssl_mode parameter is not taken from the ssl parameter as can be verified in MySQLdb code and documentation. The easiest way to confirm the error is to set the PAPERLESS_DBSSLMODE environment variable to REQUIRED and start the MySQL database by setting the require_secure_transport=on variable. Although ssl_mode was set to REQUIRED the MySQLdb engine does not see this setting and we get an error

MySQLdb.OperationalError: (3159, 'Connections using insecure transport are prohibited while --require_secure_transport=ON.')

If the ssl_mode parameter is set correctly, this error should not occur.

Type of change

  • Bug fix: non-breaking change which fixes an issue.
  • New feature / Enhancement: non-breaking change which adds functionality. Please read the important note above.
  • Breaking change: fix or feature that would cause existing functionality to not work as expected.
  • Documentation only.
  • Other. Please explain:

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have included testing coverage for new code in this PR, for backend and / or front-end changes.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@paperless-ngx-secretary
Copy link

Hello @MaciejSzczurek,

thank you very much for submitting this PR to us!

This is what will happen next:

  1. My robotic colleagues will check your changes to see if they break anything. You can see the progress below.
  2. Once that is finished, human contributors from paperless-ngx review your changes. Since this seems to be a small change, only a single contributor has to review your changes.
  3. Please improve anything that comes up during the review until your pull request gets approved.
  4. Your pull request will be merged into the dev branch. Changes there will be tested further.
  5. Eventually, changes from you and other contributors will be merged into main and a new release will be made.

Please allow up to 7 days for an initial review. We're all very excited about new pull requests but we only do this as a hobby.
If any action will be required by you, please reply within a month.

@MaciejSzczurek MaciejSzczurek marked this pull request as ready for review February 15, 2024 10:16
@MaciejSzczurek MaciejSzczurek requested a review from a team as a code owner February 15, 2024 10:16
@MaciejSzczurek MaciejSzczurek changed the title Moved ssl_mode parameter for mysql backend engine Fix: moved ssl_mode parameter for mysql backend engine Feb 15, 2024
@stumpylog
Copy link
Member

Can you point me to some documentation that this is the correct location?

@MaciejSzczurek
Copy link
Contributor Author

@stumpylog

Of course. The following documentation lists the parameters used by the mysql client that django uses to establish the connection.

https://mysqlclient.readthedocs.io/user_guide.html#functions-and-attributes

Here you can see that the ssl_mode parameter is not an element of the ssl dictionary, but a separate parameter.

@stumpylog stumpylog merged commit f6ddcfa into paperless-ngx:dev Feb 15, 2024
21 checks passed
@stumpylog
Copy link
Member

Thanks, must not be many people using SSL, it's been like that since it was added

@shamoon shamoon added this to the v2.5.3 milestone Feb 16, 2024
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. See our contributing guidelines for more details.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants