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.1k stars 5.54k forks source link

Support for LibreSSL #1278

Open kaptenhonek opened 4 years ago

kaptenhonek commented 4 years ago

Hello! Does anyone have any ideas for making folly compile with LibreSSL instead of OpenSSL? The main culprit seems to be ASN1_TIME_diff in OpenSSLCertUtils.cpp, LibreSSL doesn't have that definition.

tuxillo commented 4 years ago

Maybe something like this would help?

https://github.com/proftpd/proftpd/commit/a3d65e868308b28c1add87eadd120717a55dc57b#diff-8d90650fe394db7f70d0c0a3c070f92a

Source: https://github.com/prbinu/tls-scan/issues/6

concatime commented 3 years ago

With LibreSSL too:

folly/io/async/AsyncSSLSocket.cpp:636:25: error: 'SSL_SESSION_get0_hostname' was not declared in this scope; did you mean 'SSL_SESSION_get_time'?
  636 |   auto tlsextHostname = SSL_SESSION_get0_hostname(ss);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                         SSL_SESSION_get_time

Something like this is requried:

static inline const char *SSL_SESSION_get0_hostname(const SSL_SESSION *sess) {
    return sess->tlsext_hostname;
}

https://www.mail-archive.com/haproxy@formilux.org/msg26685.html

glowbucky commented 3 years ago

@kaptenhonek Hi, I am facing a similar issue. Have you found a solution for this?

tuxillo commented 3 years ago

https://github.com/DragonFlyBSD/DeltaPorts/commit/1100818690a205b2ba2e3534f74227f39e935b5c

glowbucky commented 3 years ago

@tuxillo Thanks for replying. Can you explain what should I do with the following lines of code you just provided? I am new to this kind of stuff so please don't mind.

kaptenhonek commented 3 years ago

@kaptenhonek Hi, I am facing a similar issue. Have you found a solution for this?

No sorry, we decided to not use Folly in our projects. Instead we used boost which has support for LibreSSL