diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2018-09-05 14:08:38 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@oath.com> | 2018-09-05 14:08:38 +0000 |
commit | 21a58e5f3845fc63b11e42f403a43ce860b464dc (patch) | |
tree | 09f7cb123831caa6f4826de617bcd178c9e8781c /vespalib | |
parent | cd9f4b62dbaba2fbf26372f57960a067c38f4fc4 (diff) |
Const cast sacrifice to satisfy the old OpenSSL gods
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp index 606e10599e7..90de2c36a24 100644 --- a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp +++ b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp @@ -88,7 +88,11 @@ void ensure_openssl_initialized_once() { BioPtr bio_from_string(vespalib::stringref str) { LOG_ASSERT(str.size() <= INT_MAX); - BioPtr bio(::BIO_new_mem_buf(&str[0], static_cast<int>(str.size()))); +#if (OPENSSL_VERSION_NUMBER > 0x10001000L) + BioPtr bio(::BIO_new_mem_buf(str.data(), static_cast<int>(str.size()))); +#else + BioPtr bio(::BIO_new_mem_buf(const_cast<char*>(str.data()), static_cast<int>(str.size()))); +#endif if (!bio) { throw CryptoException("BIO_new_mem_buf"); } |