-
-
Notifications
You must be signed in to change notification settings - Fork 18
fix: MySQL 5.7 SSL error with auto-detected client #224
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c68d723
test: add MySQL 5.7 SSL connectivity test
AaronFeledy 63ac186
ci: add db-client-mysql57 to test matrix
AaronFeledy 09f1d14
chore: add syncthing to gitignore
AaronFeledy 6c2d991
chore: remove accidental syncthing gitignore entries
AaronFeledy 9f63de9
test: use apache appserver with run commands to reproduce MySQL 5.7 S…
AaronFeledy 72b9915
fix: add ssl-mode=DISABLED to MySQL client config for local dev
AaronFeledy a833e95
fix: detect database type even when no version is specified
AaronFeledy b9d18d6
fix: use ssl-mode=PREFERRED instead of DISABLED
AaronFeledy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: lando-php-db-client-mysql57 | ||
|
|
||
| services: | ||
| # Test MySQL 5.7 auto-detection with an appserver (not cli) | ||
| # Reproduces SSL errors when mysql commands run via services.run or events | ||
| appserver: | ||
| type: php:8.4 | ||
| via: apache | ||
| run: | ||
| - mysql -h database -u testuser -ptestpass testdb -e "SELECT 1 AS connection_test" | ||
| run_as_root: | ||
| - mysql -h database -u root testdb -e "SELECT 1 AS root_connection_test" | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| database: | ||
| type: mysql:5.7 | ||
| creds: | ||
| user: testuser | ||
| password: testpass | ||
| database: testdb | ||
|
|
||
| plugins: | ||
| "@lando/php": ../.. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Database Client MySQL 5.7 SSL Test | ||
|
|
||
| This example tests that `db_client: auto` correctly handles MySQL 5.7 when using | ||
| an Apache appserver with mysql commands in `services.run` (matching a real-world | ||
| recipe scenario where SSL errors occur). | ||
|
|
||
| ## Start up tests | ||
|
|
||
| Run the following commands to get up and running with this example. | ||
|
|
||
| ```bash | ||
| # Should start up successfully with mysql run commands completing without SSL errors | ||
| lando poweroff | ||
| lando start | ||
| ``` | ||
|
|
||
| ## Verification commands | ||
|
|
||
| Run the following commands to validate things are rolling as they should. | ||
|
|
||
| ```bash | ||
| # Auto-detection installs MySQL client (not MariaDB) | ||
| lando exec appserver -- mysql --version | grep -q "mysql" | ||
| lando exec appserver -- mysql --version | grep -qi "Ver 8.0" | ||
| lando exec appserver -- mysql --version | grep -qiv "MariaDB" | ||
| ``` | ||
|
|
||
| ```bash | ||
| # MySQL client can connect to MySQL 5.7 database without SSL errors | ||
| lando exec appserver -- mysql -h database -u testuser -ptestpass testdb -e "SELECT 1" | ||
| ``` | ||
|
|
||
| ```bash | ||
| # mysqldump works against MySQL 5.7 without SSL errors | ||
| lando exec appserver -- mysqldump -h database -u testuser -ptestpass testdb --no-data > /dev/null | ||
| ``` | ||
|
|
||
| ## Destroy tests | ||
|
|
||
| Run the following commands to trash this app like nothing ever happened. | ||
|
|
||
| ```bash | ||
| # Should be destroyed with success | ||
| lando destroy -y | ||
| lando poweroff | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.