facebook / folly

An open-source C++ library developed and used at Facebook.
https://groups.google.com/forum/?fromgroups#!forum/facebook-folly
Apache License 2.0
28.09k stars 5.53k forks source link

Does folly support boringssl? #1689

Open yiguolei opened 2 years ago

yiguolei commented 2 years ago

FOLLY_OPENSSL_PREREQ is not defined if ssl is boringssl. image

But it is used in SSLContext.h.

So that I think FOLLY could not work with boringssl, Am I right?

stevezhou6 commented 2 years ago

support, but you need to adapt the code yourself.

stevezhou6 commented 2 years ago

diff --git a/folly/io/async/AsyncSSLSocket.cpp b/folly/io/async/AsyncSSLSocket.cpp index ec76ffee4..506e771d6 100644 --- a/folly/io/async/AsyncSSLSocket.cpp +++ b/folly/io/async/AsyncSSLSocket.cpp @@ -628,11 +628,17 @@ bool AsyncSSLSocket::isServerNameMatch() const { return false; }

+#ifndef BOR_SSL SSL_SESSION* ss = SSL_getsession(ssl.get()); if (!ss) { return false; }

+#else

yiguolei commented 2 years ago

Why not add a settings in CMakeList.txt to indicate using openssl or boringssl?

stevezhou6 commented 2 years ago

Different bosringssl versions are different, and the adaptive code is different. I guess he only adapted a certain version.