Skip to content

Commit 533539a

Browse files
committed
Skip certificate generation if SSL is disabled
1 parent fc3e856 commit 533539a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

5.7/docker-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
109109
"$@" --initialize-insecure
110110
echo 'Database initialized'
111111

112-
if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then
112+
sslEnabled="$(_get_config 'ssl' "$@")"
113+
if [ "$sslEnabled" = 'TRUE' ] && command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then
113114
# https://github.com/mysql/mysql-server/blob/23032807537d8dd8ee4ec1c4d40f0633cd4e12f9/packaging/deb-in/extra/mysql-systemd-start#L81-L84
114115
echo 'Initializing certificates'
115116
mysql_ssl_rsa_setup --datadir="$DATADIR"

8.0/docker-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
111111
"$@" --initialize-insecure
112112
echo 'Database initialized'
113113

114-
if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then
114+
sslEnabled="$(_get_config 'ssl' "$@")"
115+
if [ "$sslEnabled" = 'TRUE' ] && command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then
115116
# https://github.com/mysql/mysql-server/blob/23032807537d8dd8ee4ec1c4d40f0633cd4e12f9/packaging/deb-in/extra/mysql-systemd-start#L81-L84
116117
echo 'Initializing certificates'
117118
mysql_ssl_rsa_setup --datadir="$DATADIR"

0 commit comments

Comments
 (0)