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

Specify options for database connection in configuration #923

Open
galletl opened this issue Oct 21, 2022 · 2 comments
Open

Specify options for database connection in configuration #923

galletl opened this issue Oct 21, 2022 · 2 comments
Assignees

Comments

@galletl
Copy link

galletl commented Oct 21, 2022

Hello.

I want connect php-crud-api on MariaDB who accepts TLS connections only.
It's work if, in PHP code, I modify the function "getOptions" for adding those lines in mysql options block :

\PDO::MYSQL_ATTR_SSL_CAPATH => '/etc/ssl/certs',
\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true,

There is a way to specify options for database connection in configuration ?

@mevdschee mevdschee self-assigned this Oct 21, 2022
@mevdschee
Copy link
Owner

Currently the options aren't configurable, the commands are. I registered this as a feature request to make them configurable. In the meantime you can search for PDO::MYSQL_ATTR_FOUND_ROWS and add these options in the 'getOptions' method as a workaround. I'll keep this issue open as a feature request.

@mevdschee
Copy link
Owner

mevdschee commented Jul 12, 2023

You might be able to workaround this limitation using stunnel as client, see: https://www.stunnel.org/

I have found that somebody was trying to use stunnel in client mode for mysql and failed, see:

If you succeed, please let us know. I hope this helps. Kind regards, Maurits

NB: Do consider SSH tunnels (that's what I use), as they are more secure and faster.

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

2 participants