Git Product home page Git Product logo

Comments (1)

jbirtley88 avatar jbirtley88 commented on June 3, 2024

The underlying pathology of this took some digging. All of the following need to be true:

This shows up on the Windows side as a warning in the System event log (se attached):

The remote server has requested TLS client authentication, but no suitable client certificate could be found. An anonymous connection will be attempted. This TLS connection request may succeed or fail, depending on the server's policy settings.

image-20240326-202647

I suspect that this very esoteric bug started when this was merged: 28f09bf

which causes this code branch to execute:

// here we use global.tmp_ssl_ctx instead of global.ssl_ctx

and the MS client-side TLS caching is behaving very badly in the event that something about the TLS has changed (perhaps getting the tmp context insted of the global one or something - it's impossible to tell without looking at the source code)

After several days of soak-testing, I have a one-line fix for this:

--- a/src/proxy_tls.cpp
+++ b/src/proxy_tls.cpp
@@ -477,7 +477,8 @@ int ProxySQL_create_or_load_TLS(bool bootstrap, std::string& msg) {
                }
        }
        if (ret == 0) {
-               SSL_CTX_set_verify(GloVars.global.ssl_ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, callback_ssl_verify_peer);
+               // https://github.com/sysown/proxysql/issues/4419
+               SSL_CTX_set_verify(GloVars.global.ssl_ctx, SSL_VERIFY_NONE, callback_ssl_verify_peer);
        }
        X509_free(x509);
        EVP_PKEY_free(pkey);

In other words, do not perform any peer verification at all (https://www.openssl.org/docs/man1.0.2/man3/SSL_CTX_set_verify.html).

This is benign (currently) because of the current implementation of callback_ssl_verify_peer():

int callback_ssl_verify_peer(int ok, X509_STORE_CTX* ctx) {

int callback_ssl_verify_peer(int ok, X509_STORE_CTX* ctx) {
        // for now only return 1
        return 1;
}

This fix has withstood 48-hours of soak-testing under significant load (ubuntu 20.04 and ubuntu 22.04).

I'll raise a PR

from proxysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.