Skip to content

Commit 8321c13

Browse files
authored
CDRIVER-5694 deprecate use of ENABLE_SSL=LIBRESSL (#1728)
* deprecate `ENABLE_SSL=LIBRESSL` in CMake * deprecate `mongoc_stream_tls_libressl_new` * update NEWS * emit deprecation message if LibreSSL is automatically chosen
1 parent 7b0e4c6 commit 8321c13

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ mongo_setting(
119119
message(WARNING "ENABLE_SSL=DARWIN is only supported on Apple platforms")
120120
elseif(ENABLE_SSL STREQUAL "WINDOWS" AND NOT WIN32)
121121
message(WARNING "ENABLE_SSL=WINDOWS is only supported on Windows platforms")
122+
elseif (ENABLE_SSL STREQUAL "LIBRESSL")
123+
message(DEPRECATION "ENABLE_SSL=LIBRESSL is deprecated and may be removed in a future major release")
122124
endif()
123125
]]
124126
)

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Deprecated:
3333

3434
* A future minor release plans to drop support for Visual Studio 2013.
3535

36+
* `ENABLE_SSL=LIBRESSL` is deprecated along with `mongoc_stream_tls_libressl_new`. Support for LibreSSL may be dropped in a future major release.
37+
3638
libmongoc 1.27.6
3739
================
3840

src/libmongoc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ function(_auto_pick_tls_lib)
180180
# No OpenSSL. What about LibreSSL?
181181
find_package(LibreSSL)
182182
if(LibreSSL_FOUND)
183+
message(DEPRECATION "LibreSSL was automatically chosen as the TLS library. Support for LibreSSL is deprecated and may be removed in a future major release. Use ENABLE_SSL option to specify a different TLS library.")
183184
_use_named_tls_lib(LIBRESSL)
184185
endif()
185186
endif()

src/libmongoc/src/mongoc/mongoc-stream-tls-libressl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BSON_BEGIN_DECLS
2929

3030
MONGOC_EXPORT (mongoc_stream_t *)
3131
mongoc_stream_tls_libressl_new (mongoc_stream_t *base_stream, const char *host, mongoc_ssl_opt_t *opt, int client)
32-
BSON_GNUC_WARN_UNUSED_RESULT;
32+
BSON_GNUC_DEPRECATED BSON_GNUC_WARN_UNUSED_RESULT;
3333

3434
BSON_END_DECLS
3535

src/libmongoc/src/mongoc/mongoc-stream-tls.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "mongoc-stream-tls-secure-channel.h"
4343
#endif
4444
#include "mongoc-stream-tls.h"
45+
#include "mongoc-util-private.h" // BEGIN_IGNORE_DEPRECATIONS
4546

4647
#undef MONGOC_LOG_DOMAIN
4748
#define MONGOC_LOG_DOMAIN "stream-tls"
@@ -206,7 +207,9 @@ mongoc_stream_tls_new_with_hostname (mongoc_stream_t *base_stream, const char *h
206207
#if defined(MONGOC_ENABLE_SSL_OPENSSL)
207208
return mongoc_stream_tls_openssl_new (base_stream, host, opt, client);
208209
#elif defined(MONGOC_ENABLE_SSL_LIBRESSL)
210+
BEGIN_IGNORE_DEPRECATIONS
209211
return mongoc_stream_tls_libressl_new (base_stream, host, opt, client);
212+
END_IGNORE_DEPRECATIONS
210213
#elif defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT)
211214
return mongoc_stream_tls_secure_transport_new (base_stream, host, opt, client);
212215
#elif defined(MONGOC_ENABLE_SSL_SECURE_CHANNEL)

0 commit comments

Comments
 (0)