Created
May 19, 2020 00:22
-
-
Save mike-marcacci/e0a695cc2424a27b71faa08e9447aa87 to your computer and use it in GitHub Desktop.
Querious CA cert bug
This file contains 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
printf "\nConnect to mysql...\n\n" | |
printf "Using this user: root\n" | |
printf "Using this password: root-password\n" | |
# Create a temporary mysql instance using docker, letting the OS chose a port. | |
container=$(docker run -e MYSQL_ROOT_PASSWORD=root-password -d --rm -p 3306 mysql) | |
# Print the host port used. | |
printf "Using this port:\n" | |
docker container port $container | |
# Print the CA cert. | |
printf "\nWaiting for cert..." | |
file=$(pwd)/$container-ca-cert.pem | |
until docker exec $container cat /var/lib/mysql/ca.pem 2>/dev/null > $file; do | |
sleep 1 | |
printf "." | |
done | |
printf "\n\nUse the cert at: \n $file\n" | |
# Wait for enter. | |
printf "\nWhen you're done testing, press enter to clean up." | |
read > /dev/null | |
# Cleanup. | |
docker kill $container | |
rm $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment