Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rippled does not build with OpenSSL 1.1 #2047

Closed
MarkusTeufelberger opened this issue Mar 12, 2017 · 6 comments
Closed

Rippled does not build with OpenSSL 1.1 #2047

MarkusTeufelberger opened this issue Mar 12, 2017 · 6 comments

Comments

@MarkusTeufelberger
Copy link
Collaborator

Since a clear set of dependencies is not documented on https://ripple.com/build/rippled-setup/#installing-rippled (and the page linked there - https://wiki.ripple.com/Rippled_build_instructions - has a big warning header and is quite outdated too), I just wanted to bring this to your attention this way, in case someone wants to build against the latest version of OpenSSL. It won't work.

@MarkusTeufelberger
Copy link
Collaborator Author

Ok, I researched a bit more. Apparently the issue is with rippled checking for the "SSL_R_SHORT_READ" error code in https://github.com/ripple/rippled/blob/develop/src/ripple/beast/asio/ssl_error.h#L72. OpenSSL removed this one in openssl/openssl@45f55f6 when it removed SSLv2 support (which is not supported by rippled anyways).

I'm not sure who is responsible for OpenSSL stuff, but probably @nbougalis or @JoelKatz are the ones or at least know who could/should fix this (most likely by removing a bunch of error handling code). Also pinging @vinniefalco, since this is happening in beast code.

This issue seems to affect building rippled with upstream packages on: Fedora rawhide, Debian Stretch and Sid, potentially more (these are just amongst the ones I'm testing).

@JoelKatz
Copy link
Collaborator

JoelKatz commented Apr 7, 2017

I wonder if this is the fix:

/** Returns `true` if the error code is a SSL "short read." */
inline
bool
is_short_read(boost::system::error_code const& ec)
{
#ifdef SSL_R_SHORT_READ
    return (ec.category() == boost::asio::error::get_ssl_category())
        && (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ);
#else
    return false;
#endif
}

@MarkusTeufelberger
Copy link
Collaborator Author

It definitely is a fix. Personally I would prefer removing code to just ifdefing it away, but it should work.

@MarkusTeufelberger
Copy link
Collaborator Author

Any updates? My distro upgraded to OpenSSL 1.1 and rippled now does not build any more...

@MarkusTeufelberger
Copy link
Collaborator Author

https://github.com/ripple/rippled/blob/develop/src/ripple/basics/impl/make_SSLContext.cpp#L211 refers to SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS and tries to set this flag. It is not used any more since OpenSSL 1.1.1 (according to https://github.com/openssl/openssl/blob/master/include/openssl/ssl3.h#L263) and thus it might be easiest to just remove the problematic call alltogether.

After a quick 'n' dirty ifdef, rippled builds with OpenSSL 1.1 and passes unit tests (except the test case in beast_asio_error_test.cpp which checks for short read detection):

#if OPENSSL_VERSION_NUMBER < 0x10100000L
static
void
info_handler (SSL const* ssl, int event, int)
{
    if ((ssl->s3) && (event & SSL_CB_HANDSHAKE_START))
    {
        if (disallowRenegotiation (ssl, SSL_in_before (ssl)))
            ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
    }
}
#else
static
void
info_handler (SSL const* ssl, int event, int)
{
// empty
}
#endif

MarkusTeufelberger added a commit to MarkusTeufelberger/rippled that referenced this issue Jun 4, 2017
MarkusTeufelberger added a commit to MarkusTeufelberger/rippled that referenced this issue Jun 4, 2017
vinniefalco pushed a commit to vinniefalco/rippled that referenced this issue Jun 12, 2017
miguelportilla pushed a commit to miguelportilla/rippled that referenced this issue Jun 16, 2017
miguelportilla pushed a commit to miguelportilla/rippled that referenced this issue Jun 16, 2017
@MarkusTeufelberger
Copy link
Collaborator Author

fixed in #2151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants