Skip to content

Commit 7bd2dce

Browse files
lawrinlawrin
authored andcommitted
Connector/C++ doesn't implement MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH. Introduced connection options "sslVerify"(boolean), "sslCRL" and "sslCRLPath"(string). (Bug#18461451)
1 parent c35d589 commit 7bd2dce

File tree

3 files changed

+51
-5
lines changed

3 files changed

+51
-5
lines changed

CHANGES

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@
2222
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
*/
2424

25-
GA 1.1.4 - 2013-07-02
25+
GA 1.1.4 -
2626
- Both static and dynamic driver libraries are now linked statically against
2727
libmysql library
2828
- Cannot Connect error when using legacy authentication. (Bug#16970753/69492)
29-
- Built against libmysql 5.6.11
29+
- Connector/C++ doesn't implement MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
30+
MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH. Introduced connection options
31+
"sslVerify"(boolean), "sslCRL" and "sslCRLPath"(string). (Bug#18461451)
32+
33+
- Built against libmysql 5.6.
3034

3135
GA 1.1.3 - 2013-03-22
3236
- Added boolean connection option OPT_ENABLE_CLEARTEXT_PLUGIN allowing to

driver/mysql_connection.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ static bool read_connection_flag(ConnectOptionsMap::const_iterator &cit, int &fl
231231
static const String2IntMap booleanOptions[]=
232232
{
233233
{"OPT_REPORT_DATA_TRUNCATION", MYSQL_REPORT_DATA_TRUNCATION},
234-
{"OPT_ENABLE_CLEARTEXT_PLUGIN", MYSQL_ENABLE_CLEARTEXT_PLUGIN}
234+
{"OPT_ENABLE_CLEARTEXT_PLUGIN", MYSQL_ENABLE_CLEARTEXT_PLUGIN},
235+
{"sslVerify", MYSQL_OPT_SSL_VERIFY_SERVER_CERT}
235236
};
236237
/* Array for mapping of integer connection options to mysql_options call */
237238
static const String2IntMap intOptions[]=
@@ -243,7 +244,9 @@ static const String2IntMap intOptions[]=
243244
/* Array for mapping of string connection options to mysql_options call */
244245
static const String2IntMap stringOptions[]=
245246
{
246-
{"preInit", MYSQL_INIT_COMMAND}
247+
{"preInit", MYSQL_INIT_COMMAND},
248+
{"sslCRL", MYSQL_OPT_SSL_CRL},
249+
{"sslCRLPath", MYSQL_OPT_SSL_CRLPATH}
247250
};
248251

249252
template<class T>
@@ -343,7 +346,7 @@ void MySQL_Connection::init(ConnectOptionsMap & properties)
343346
bool opt_reconnect = false;
344347
bool opt_reconnect_value = false;
345348
bool client_doesnt_support_exp_pwd = false;
346-
bool secure_auth= true;
349+
bool secure_auth= true;
347350

348351

349352
/* Values set in properties individually should have priority over those

test/unit/classes/connection.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,45 @@ void connection::connectUsingMapWrongTypes()
860860
}
861861
connection_properties.erase("OPT_REPORT_DATA_TRUNCATION");
862862

863+
try
864+
{
865+
connection_properties["sslVerify"]=(strval);
866+
created_objects.clear();
867+
con.reset(driver->connect(connection_properties));
868+
FAIL("No exception XXXI - sslVerify");
869+
}
870+
catch (sql::InvalidArgumentException)
871+
{
872+
/* expected */
873+
}
874+
connection_properties.erase("sslVerify");
875+
876+
try
877+
{
878+
connection_properties["sslCRL"]=(boolval);
879+
created_objects.clear();
880+
con.reset(driver->connect(connection_properties));
881+
FAIL("No exception XXXII - sslCRL");
882+
}
883+
catch (sql::InvalidArgumentException)
884+
{
885+
/* expected */
886+
}
887+
connection_properties.erase("sslCRL");
888+
889+
try
890+
{
891+
connection_properties["sslCRLPath"]=(boolval);
892+
created_objects.clear();
893+
con.reset(driver->connect(connection_properties));
894+
FAIL("No exception XXXIII - sslCRLPath");
895+
}
896+
catch (sql::InvalidArgumentException)
897+
{
898+
/* expected */
899+
}
900+
connection_properties.erase("sslCRLPath");
901+
863902
}
864903
catch (sql::SQLException &e)
865904
{

0 commit comments

Comments
 (0)