diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index 1814df44b..a1e3d84b3 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -1804,6 +1804,11 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user, ER(CR_SERVER_LOST_EXTENDED), "handshake: reading initial communication packet", errno); + else if (mysql->options.use_ssl) + my_set_error(mysql, CR_CONNECTION_ERROR, SQLSTATE_UNKNOWN, + "Received error packet before completion of TLS handshake. " + "The authenticity of the following error cannot be verified:\n%d - %s", + mysql->net.last_errno, mysql->net.last_error); goto error; }