472590df500280dc4e82cf0e9aacd5fad147908b max Mon Nov 4 04:52:54 2024 -0800 fix for mysql8 client libs, refs #34723 diff --git src/hg/lib/jksql.c src/hg/lib/jksql.c index 77fedfd..d4a67e7 100644 --- src/hg/lib/jksql.c +++ src/hg/lib/jksql.c @@ -1116,32 +1116,33 @@ long oldTime = monitorEnterTime; monitorEnterTime = 0; monitorEnter(); if ((sc->conn = conn = mysql_init(NULL)) == NULL) // no need for monitorLeave here errAbort("Couldn't connect to mySQL."); // Fix problem where client LOCAL setting is disabled by default for security mysql_options(conn, MYSQL_OPT_LOCAL_INFILE, NULL); // Boolean option to tell client to verify that the host server certificate Subject CN equals the hostname. // If turned on this can defeat Man-In-The-Middle attacks. if (sp->verifyServerCert && !sameString(sp->verifyServerCert,"0")) { - #if !defined(MARIADB_VERSION_ID) && MYSQL_VERSION_ID >= 80000 - mysql_options(conn, MYSQL_OPT_SSL_MODE, SSL_MODE_REQUIRED); + #if !defined(MARIADB_BASE_VERSION) && defined(MYSQL_VERSION_ID) && (MYSQL_VERSION_ID >= 80000) + int ssl_mode = SSL_MODE_REQUIRED; + mysql_options(conn, MYSQL_OPT_SSL_MODE, &ssl_mode); #else my_bool flag = TRUE; mysql_options(conn, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &flag); #endif } #if (MYSQL_VERSION_ID >= 50603) // mysql version "5.6.3" // If certificate revocation list file provided, set mysql option if (sp->crl) mysql_options(conn, MYSQL_OPT_SSL_CRL, &sp->crl); // If path to directory with crl files provided, set mysql option if (sp->crlPath) mysql_options(conn, MYSQL_OPT_SSL_CRLPATH, &sp->crlPath); #endif