Updating submodules
[hiphop-php.git] / third-party / squangle / patches / 0001-only-disable-SSL-mode-if-we-have-a-MySQL-client-lib-.patch
blobcf88aca09b15600b508dfdb2b6da38a8d05f020e
1 From 5237d8ce57269a2f58d1b491f76684d632f96d85 Mon Sep 17 00:00:00 2001
2 From: Fred Emmott <fe@fb.com>
3 Date: Thu, 30 Aug 2018 10:58:40 -0700
4 Subject: [PATCH] only disable SSL mode if we have a MySQL client lib that
5 supports it
7 ---
8 squangle/mysql_client/AsyncMysqlClient.cpp | 2 ++
9 squangle/mysql_client/SSLOptionsProviderBase.cpp | 2 ++
10 2 files changed, 4 insertions(+)
12 Index: bundled_squangle/squangle/mysql_client/SSLOptionsProviderBase.cpp
13 ===================================================================
14 --- bundled_squangle.orig/squangle/mysql_client/SSLOptionsProviderBase.cpp
15 +++ bundled_squangle/squangle/mysql_client/SSLOptionsProviderBase.cpp
16 @@ -20,8 +20,10 @@ bool SSLOptionsProviderBase::setMysqlSSL
18 // We need to set ssl_mode because we set it to disabled after we call
19 // mysql_init.
20 +#ifdef MYSQL_OPT_SSL_MODE
21 enum mysql_ssl_mode ssl_mode = SSL_MODE_PREFERRED;
22 mysql_options(mysql, MYSQL_OPT_SSL_MODE, &ssl_mode);
23 +#endif
24 mysql_options(mysql, MYSQL_OPT_SSL_CONTEXT, sslContext->getSSLCtx());
25 auto sslSession = getRawSSLSession();
26 if (sslSession) {
27 Index: bundled_squangle/squangle/mysql_client/Connection.cpp
28 ===================================================================
29 --- bundled_squangle.orig/squangle/mysql_client/Connection.cpp
30 +++ bundled_squangle/squangle/mysql_client/Connection.cpp
31 @@ -46,9 +46,11 @@ void Connection::initMysqlOnly() {
32 if (!mysql_client_->supportsLocalFiles()) {
33 mysql_connection_->mysql()->options.client_flag &= ~CLIENT_LOCAL_FILES;
35 +#ifdef MYSQL_OPT_SSL_MODE
36 // Turn off SSL by default for tests that rely on this.
37 enum mysql_ssl_mode ssl_mode = SSL_MODE_DISABLED;
38 mysql_options(mysql_connection_->mysql(), MYSQL_OPT_SSL_MODE, &ssl_mode);
39 +#endif
42 void Connection::initialize(bool initMysql) {