75f1385d737808f6df3d81103f5427cf786b9cef
jcasper
  Thu Nov 20 10:32:49 2025 -0800
Fixing issue with apiKeys not validating when the central server is remote, refs #36428

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index a9eb1c5ee5f..74dc75fbf87 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -829,32 +829,32 @@
 if (centralCc == NULL)
     hCentralMkCache();
 return sqlConnCacheAlloc(centralCc, centralDb);
 }
 
 void hDisconnectCentral(struct sqlConnection **pConn)
 /* Put back connection for reuse. */
 {
 if (*pConn != NULL)
     sqlConnCacheDealloc(centralCc, pConn);
 }
 
 struct sqlConnection *hConnectCentralNoCache() 
 /* open an hgcentral connection, but do not use the cache. Used before the bottleneck call. */
 {
-    char *centralDb = cfgOption2(centralProfile, "db");
-    struct sqlConnection *conn = sqlMayConnect(centralDb);
+    char *centDb = cfgOption2(centralProfile, "db");
+    struct sqlConnection *conn = sqlConnectProfile(centralProfile, centDb);
     if (conn == NULL)
         errAbort("Cannot connect to MariaDB database defined in hg.conf called '%s'", centralDb);
     return conn;
 }
 
 static void hCartMkCache()
 /* Create the cart connection cache.  Defaults to the central connection
  * unless cart.db or cart.host are configured. */
 {
 if ((cfgOption("cart.db") != NULL) || (cfgOption("cart.host") != NULL)
     || (cfgOption("cart.user") != NULL) || (cfgOption("cart.password") != NULL))
     {
     /* use explict cart options */
     cartDb = cfgOption("cart.db");
     if ((cartDb == NULL) || (cfgOption("cart.host") == NULL)