mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Add SSL support to the mysql module.
This commit is contained in:
parent
3ac6d92316
commit
3af79a556e
@ -1509,7 +1509,7 @@
|
||||
# mysql is more complex than described here, see the docs for more #
|
||||
# info: https://docs.inspircd.org/3/modules/mysql #
|
||||
#
|
||||
#<database module="mysql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database2">
|
||||
#<database module="mysql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database2" ssl="no">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Named modes module: Allows for the display and set/unset of channel
|
||||
|
@ -341,6 +341,10 @@ class SQLConnection : public SQL::Provider
|
||||
unsigned int timeout = config->getDuration("timeout", 5, 1, 30);
|
||||
mysql_options(connection, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
|
||||
|
||||
// Enable SSL if requested.
|
||||
unsigned int ssl = config->getBool("ssl") ? SSL_MODE_REQUIRED : SSL_MODE_PREFERRED;
|
||||
mysql_options(connection, MYSQL_OPT_SSL_MODE, &ssl);
|
||||
|
||||
// Attempt to connect to the database.
|
||||
const std::string host = config->getString("host");
|
||||
const std::string user = config->getString("user");
|
||||
|
Loading…
x
Reference in New Issue
Block a user