Last active
January 5, 2017 08:39
-
-
Save usagi/b8e7d54affceb223a77a3d47efef578e to your computer and use it in GitHub Desktop.
LibreSSL と Boost.ASIO.SSL を組み合わせて使う事になった場合に ::SSL_CTX_get_default_passwd_cb_userdata 等複数箇所で翻訳時エラーが生じてしまう場合の応急対処法 ref: http://qiita.com/usagi/items/acee410849ca8f4f9c11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...include/boost/asio/ssl/impl/context.ipp: In destructor 'boost::asio::ssl::context::~context()': | |
.../include/boost/asio/ssl/impl/context.ipp:232:25: error: '::SSL_CTX_get_default_passwd_cb_userdata' has not been declared | |
void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); | |
^~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) | |
void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); | |
#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) | |
void* cb_userdata = handle_->default_passwd_callback_userdata; | |
#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) \ | |
&& (OPENSSL_VERSION_NUMBER < 0x10100000L) | |
::SSL_COMP_free_compression_methods(); | |
#endif // (OPENSSL_VERSION_NUMBER >= 0x10002000L) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define OPENSSL_VERSION_NUMBER 0x10100040L | |
# ifdef OPENSSL_FIPS | |
# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0d-fips-dev xx XXX xxxx" | |
# else | |
# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0d-dev xx XXX xxxx" | |
# endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* These will never change */ | |
#define OPENSSL_VERSION_NUMBER 0x20000000L | |
#define OPENSSL_VERSION_TEXT LIBRESSL_VERSION_TEXT | |
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LIBRESSL_VERSION_NUMBER 0x2030200fL | |
#define LIBRESSL_VERSION_TEXT "LibreSSL 2.3.2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @brief LibreSSL と Boost.ASIO.SSL の OpenSSL-1.1 API 対応判定の偽装処理 | |
/// @ref http://qiita.com/usagi/items/acee410849ca8f4f9c11 | |
/// @{ | |
#if LIBRESSL_VERSION_NUMBER <= 0x2050100fL | |
#include <openssl/opensslv.h> | |
#undef OPENSSL_VERSION_NUMBER | |
#define OPENSSL_VERSION_NUMBER 0x10001fffL | |
#endif | |
/// @} | |
#include <boost/asio/ssl.hpp> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment