summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2023-03-09 11:22:41 +0100
committerSergei Golubchik <serg@mariadb.org>2023-03-13 19:49:32 +0100
commit1d0d7c45dc8cd644715f3e5424df29bb39f4c958 (patch)
tree397ccfc69b55f2e3a79ef7d075bfe4c005ab796c
parent01402e3c8a058db29006272a10d9511f3c2d01a6 (diff)
downloadmariadb-git-1d0d7c45dc8cd644715f3e5424df29bb39f4c958.tar.gz
MDEV-30818 invalid ssl prevents bootstrap
in bootstrap the server reads stdin and does not listen to network. it won't use ssl anyway
-rw-r--r--mysql-test/main/bootstrap.result6
-rw-r--r--mysql-test/main/bootstrap.test13
-rw-r--r--sql/mysqld.cc5
3 files changed, 23 insertions, 1 deletions
diff --git a/mysql-test/main/bootstrap.result b/mysql-test/main/bootstrap.result
index 6801791221e..2226f1f13f6 100644
--- a/mysql-test/main/bootstrap.result
+++ b/mysql-test/main/bootstrap.result
@@ -34,4 +34,10 @@ name dl
EXAMPLE ha_example.so
truncate table mysql.plugin;
# Kill the server
+#
+# MDEV-30818 invalid ssl prevents bootstrap
+#
+#
+# End of 10.3 tests
+#
# restart
diff --git a/mysql-test/main/bootstrap.test b/mysql-test/main/bootstrap.test
index 1c8dafd8f28..ae44ad54119 100644
--- a/mysql-test/main/bootstrap.test
+++ b/mysql-test/main/bootstrap.test
@@ -124,6 +124,19 @@ EOF
--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
+--echo #
+--echo # MDEV-30818 invalid ssl prevents bootstrap
+--echo #
+--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
+use test;
+EOF
+--exec $MYSQLD_BOOTSTRAP_CMD --ssl-ca=/dev/nonexistent < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
+
#
# MDEV-13397 MariaDB upgrade fail when using default_time_zone
#
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ebefaf00282..df7605e95c2 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4438,7 +4438,10 @@ static void init_ssl()
{
sql_print_error("Failed to setup SSL");
sql_print_error("SSL error: %s", sslGetErrString(error));
- unireg_abort(1);
+ if (!opt_bootstrap)
+ unireg_abort(1);
+ opt_use_ssl = 0;
+ have_ssl= SHOW_OPTION_DISABLED;
}
else
ssl_acceptor_stats.init();