"Fossies" - the Fresh Open Source Software Archive

Member "hhvm-HHVM-4.166.0/third-party/squangle/patches/0001-only-disable-SSL-mode-if-we-have-a-MySQL-client-lib-.patch" (8 Aug 2022, 1812 Bytes) of package /linux/www/hhvm-HHVM-4.166.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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
    6 
    7 ---
    8  squangle/mysql_client/AsyncMysqlClient.cpp       | 2 ++
    9  squangle/mysql_client/SSLOptionsProviderBase.cpp | 2 ++
   10  2 files changed, 4 insertions(+)
   11 
   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
   17    }
   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;
   34    }
   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
   40  }
   41  
   42  void Connection::initialize(bool initMysql) {