Const cast sacrifice to satisfy the old OpenSSL gods
@@ -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");
}
