/[LeafOK_CVS]/lbbs/src/database.c
ViewVC logotype

Diff of /lbbs/src/database.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.26 by sysadm, Wed Nov 26 14:38:27 2025 UTC Revision 1.27 by sysadm, Thu Nov 27 11:24:46 2025 UTC
# Line 38  MYSQL *db_open() Line 38  MYSQL *db_open()
38  #endif  #endif
39          char sql[SQL_BUFFER_LEN];          char sql[SQL_BUFFER_LEN];
40          int fd;          int fd;
41            int have_ca_cert = 0;
42    
43          db = mysql_init(NULL);          db = mysql_init(NULL);
44          if (db == NULL)          if (db == NULL)
# Line 57  MYSQL *db_open() Line 58  MYSQL *db_open()
58          else          else
59          {          {
60                  close(fd);                  close(fd);
61                    have_ca_cert = 1;
62  #ifndef HAVE_MARIADB_CLIENT  #ifndef HAVE_MARIADB_CLIENT
63                  ssl_mode = SSL_MODE_VERIFY_CA;                  ssl_mode = SSL_MODE_VERIFY_CA;
64  #endif  #endif
65          }          }
66    
67          if (mysql_ssl_set(db, NULL, NULL, DB_ca_cert, NULL, NULL) != 0)          if (mysql_ssl_set(db, NULL, NULL, (have_ca_cert ? DB_ca_cert : NULL), NULL, NULL) != 0)
68          {          {
69                  log_error("mysql_ssl_set() error\n");                  log_error("mysql_ssl_set() error\n");
70                  return NULL;                  return NULL;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1