aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/config.c2
-rw-r--r--src/sql.c3
-rw-r--r--src/sql.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 6c351d9..c877c26 100644
--- a/src/config.c
+++ b/src/config.c
@@ -632,6 +632,8 @@ static struct grecs_keyword sql_kw[] = {
grecs_type_string, NULL, offsetof(struct sqlconn, user) },
{ "password", N_("arg"), N_("Set SQL user password"),
grecs_type_string, NULL, offsetof(struct sqlconn, password) },
+ { "ssl-ca", N_("file"), N_("File name of the Certificate Authority (CA) certificate"),
+ grecs_type_string, NULL, offsetof(struct sqlconn, cacert) },
{ NULL }
};
diff --git a/src/sql.c b/src/sql.c
index ee40152..b8c1d42 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -70,6 +70,9 @@ sql_init_method (struct access_method *method)
if (conn->initcount++ == 0)
{
mysql_init (&conn->mysql);
+ if (conn->cacert)
+ mysql_ssl_set (&conn->mysql, NULL, NULL, conn->cacert,
+ NULL, NULL);
if (!mysql_real_connect (&conn->mysql, conn->host, conn->user,
conn->password, conn->database, conn->port,
conn->socket, 0))
diff --git a/src/sql.h b/src/sql.h
index d581e57..1780052 100644
--- a/src/sql.h
+++ b/src/sql.h
@@ -25,6 +25,7 @@ struct sqlconn
char *database;
char *user;
char *password;
+ char *cacert;
size_t initcount; /* Number of initializations */
MYSQL mysql;
MYSQL_RES *result;

Return to:

Send suggestions and report system problems to the System administrator.