Skip to content

Commit 826bafd

Browse files
authored
CDRIVER-5693 drop support for LibreSSL (#1931)
1 parent 7eb631a commit 826bafd

32 files changed

+43
-1275
lines changed

.evergreen/config_generator/components/earthly.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# Other options: SSPI (Windows only), AUTO (not reliably test-able without more environments)
3737
SASLOption = Literal["Cyrus", "off"]
3838
"Valid options for the SASL configuration parameter"
39-
TLSOption = Literal["LibreSSL", "OpenSSL", "off"]
39+
TLSOption = Literal["OpenSSL", "off"]
4040
"Options for the TLS backend configuration parameter (AKA 'ENABLE_SSL')"
4141
CxxVersion = Literal["r4.0.0", "none"]
4242
"C++ driver refs that are under CI test"
@@ -142,9 +142,6 @@ def task_filter(env: EarthlyVariant, conf: Configuration) -> bool:
142142
configuration values.
143143
"""
144144
match env, conf:
145-
# Ubuntu and CentOS do not ship with a LibreSSL package:
146-
case e, (_sasl, "LibreSSL", _cxx) if re.match(r"^Ubuntu|^CentOS", e.display_name):
147-
return False
148145
# u16/centos7 are not capable of building mongocxx
149146
case e, (_sasl, _tls, cxx) if re.match(r"^Ubuntu 16|^CentOS 7", e.display_name):
150147
# Only build if C++ driver is test is disabled

.evergreen/generated_configs/legacy-config.yml

+1-61
Original file line numberDiff line numberDiff line change
@@ -1576,63 +1576,6 @@ tasks:
15761576
env SASL=OFF SSL=OPENSSL .evergreen/scripts/compile.sh
15771577
- func: run auth tests
15781578
- func: upload-build
1579-
- name: build-and-run-authentication-tests-libressl-2.5
1580-
commands:
1581-
- func: install ssl
1582-
vars:
1583-
SSL: libressl-2.5.2
1584-
- func: find-cmake-latest
1585-
- command: shell.exec
1586-
type: test
1587-
params:
1588-
working_dir: mongoc
1589-
add_expansions_to_env: true
1590-
shell: bash
1591-
script: |-
1592-
set -o errexit
1593-
env SASL=OFF SSL=LIBRESSL .evergreen/scripts/compile.sh
1594-
- func: run auth tests
1595-
vars:
1596-
require_tls12: true
1597-
- func: upload-build
1598-
- name: build-and-run-authentication-tests-libressl-3.0-auto
1599-
commands:
1600-
- func: install ssl
1601-
vars:
1602-
SSL: libressl-3.0.2
1603-
- func: find-cmake-latest
1604-
- command: shell.exec
1605-
type: test
1606-
params:
1607-
working_dir: mongoc
1608-
add_expansions_to_env: true
1609-
shell: bash
1610-
script: |-
1611-
set -o errexit
1612-
env SASL=OFF SSL=AUTO .evergreen/scripts/compile.sh
1613-
- func: run auth tests
1614-
vars:
1615-
require_tls12: true
1616-
- func: upload-build
1617-
- name: build-and-run-authentication-tests-libressl-3.0
1618-
commands:
1619-
- func: install ssl
1620-
vars:
1621-
SSL: libressl-3.0.2
1622-
- func: find-cmake-latest
1623-
- command: shell.exec
1624-
type: test
1625-
params:
1626-
working_dir: mongoc
1627-
add_expansions_to_env: true
1628-
shell: bash
1629-
script: |-
1630-
set -o errexit
1631-
env SASL=OFF SSL=LIBRESSL .evergreen/scripts/compile.sh
1632-
- func: run auth tests
1633-
vars:
1634-
require_tls12: true
1635-
- func: upload-build
16361579
- name: test-latest-server-ipv6-client-ipv6-noauth-nosasl-nossl
16371580
tags:
16381581
- ipv4-ipv6
@@ -16404,16 +16347,13 @@ buildvariants:
1640416347
tags:
1640516348
- pr-merge-gate
1640616349
- name: openssl
16407-
display_name: OpenSSL / LibreSSL
16350+
display_name: OpenSSL
1640816351
run_on: archlinux-build
1640916352
tasks:
1641016353
- build-and-run-authentication-tests-openssl-1.0.1
1641116354
- build-and-run-authentication-tests-openssl-1.0.2
1641216355
- build-and-run-authentication-tests-openssl-1.1.0
1641316356
- build-and-run-authentication-tests-openssl-1.0.1-fips
16414-
- build-and-run-authentication-tests-libressl-2.5
16415-
- build-and-run-authentication-tests-libressl-3.0-auto
16416-
- build-and-run-authentication-tests-libressl-3.0
1641716357
- name: clang37
1641816358
display_name: clang 3.7 (Archlinux)
1641916359
expansions:

.evergreen/generated_configs/tasks.yml

-80
Original file line numberDiff line numberDiff line change
@@ -1097,46 +1097,6 @@ tasks:
10971097
- name: check-headers
10981098
commands:
10991099
- func: check-headers
1100-
- name: "check:sasl=Cyrus\_\u2022\_tls=LibreSSL\_\u2022\_test_mongocxx_ref=r4.0.0"
1101-
run_on:
1102-
- ubuntu2204-large
1103-
- debian10-large
1104-
- debian11-large
1105-
- amazon2
1106-
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc]
1107-
commands:
1108-
- command: subprocess.exec
1109-
type: setup
1110-
params:
1111-
binary: bash
1112-
args:
1113-
- -c
1114-
- docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"
1115-
- command: subprocess.exec
1116-
type: setup
1117-
params:
1118-
binary: ./tools/earthly.sh
1119-
working_dir: mongoc
1120-
args:
1121-
- +env-warmup
1122-
- --sasl=Cyrus
1123-
- --tls=LibreSSL
1124-
- --test_mongocxx_ref=r4.0.0
1125-
- --env=${MONGOC_EARTHLY_ENV}
1126-
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
1127-
- command: subprocess.exec
1128-
type: test
1129-
params:
1130-
binary: ./tools/earthly.sh
1131-
working_dir: mongoc
1132-
args:
1133-
- +run
1134-
- --targets=test-example test-cxx-driver
1135-
- --sasl=Cyrus
1136-
- --tls=LibreSSL
1137-
- --test_mongocxx_ref=r4.0.0
1138-
- --env=${MONGOC_EARTHLY_ENV}
1139-
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
11401100
- name: "check:sasl=Cyrus\_\u2022\_tls=OpenSSL\_\u2022\_test_mongocxx_ref=none"
11411101
run_on:
11421102
- ubuntu2204-large
@@ -1297,46 +1257,6 @@ tasks:
12971257
- --test_mongocxx_ref=r4.0.0
12981258
- --env=${MONGOC_EARTHLY_ENV}
12991259
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
1300-
- name: "check:sasl=off\_\u2022\_tls=LibreSSL\_\u2022\_test_mongocxx_ref=r4.0.0"
1301-
run_on:
1302-
- ubuntu2204-large
1303-
- debian10-large
1304-
- debian11-large
1305-
- amazon2
1306-
tags: [earthly, pr-merge-gate, alpine3.16-clang, alpine3.16-gcc, alpine3.17-clang, alpine3.17-gcc, alpine3.18-clang, alpine3.18-gcc, alpine3.19-clang, alpine3.19-gcc, archlinux-clang, archlinux-gcc]
1307-
commands:
1308-
- command: subprocess.exec
1309-
type: setup
1310-
params:
1311-
binary: bash
1312-
args:
1313-
- -c
1314-
- docker login -u "${artifactory_username}" --password-stdin artifactory.corp.mongodb.com <<<"${artifactory_password}"
1315-
- command: subprocess.exec
1316-
type: setup
1317-
params:
1318-
binary: ./tools/earthly.sh
1319-
working_dir: mongoc
1320-
args:
1321-
- +env-warmup
1322-
- --sasl=off
1323-
- --tls=LibreSSL
1324-
- --test_mongocxx_ref=r4.0.0
1325-
- --env=${MONGOC_EARTHLY_ENV}
1326-
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
1327-
- command: subprocess.exec
1328-
type: test
1329-
params:
1330-
binary: ./tools/earthly.sh
1331-
working_dir: mongoc
1332-
args:
1333-
- +run
1334-
- --targets=test-example test-cxx-driver
1335-
- --sasl=off
1336-
- --tls=LibreSSL
1337-
- --test_mongocxx_ref=r4.0.0
1338-
- --env=${MONGOC_EARTHLY_ENV}
1339-
- --c_compiler=${MONGOC_EARTHLY_C_COMPILER}
13401260
- name: "check:sasl=off\_\u2022\_tls=OpenSSL\_\u2022\_test_mongocxx_ref=none"
13411261
run_on:
13421262
- ubuntu2204-large

.evergreen/legacy_config_generator/evergreen_config_lib/tasks.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
CFLAGS: str | None = None,
5656
LDFLAGS: str | None = None,
5757
EXTRA_CONFIGURE_FLAGS: str | None = None,
58-
SSL: Literal["WINDOWS", "DARWIN", "OPENSSL", "OPENSSL_STATIC", "LIBRESSL", "OFF", None] = None,
58+
SSL: Literal["WINDOWS", "DARWIN", "OPENSSL", "OPENSSL_STATIC", "OFF", None] = None,
5959
ENABLE_SHM_COUNTERS: OptToggleStr = None,
6060
CHECK_LOG: OptToggleStr = None,
6161
TRACING: OptToggleStr = None,
@@ -773,8 +773,6 @@ def __init__(
773773

774774
if enable_ssl is not False:
775775
script += " SSL=" + enable_ssl
776-
elif "libressl" in version:
777-
script += " SSL=LIBRESSL"
778776
else:
779777
script += " SSL=OPENSSL"
780778

@@ -818,10 +816,7 @@ def name(self):
818816
"l",
819817
cflags="-Wno-redundant-decls",
820818
),
821-
SSLTask("openssl-1.1.0", "l"),
822-
SSLTask("libressl-2.5", ".2", test_params=dict(require_tls12=True)),
823-
SSLTask("libressl-3.0", ".2", enable_ssl="AUTO", test_params=dict(require_tls12=True)),
824-
SSLTask("libressl-3.0", ".2", test_params=dict(require_tls12=True)),
819+
SSLTask("openssl-1.1.0", "l")
825820
],
826821
)
827822

.evergreen/legacy_config_generator/evergreen_config_lib/variants.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,13 @@ def days(n: int) -> int:
8282
),
8383
Variant(
8484
"openssl",
85-
"OpenSSL / LibreSSL",
85+
"OpenSSL",
8686
"archlinux-build",
8787
[
8888
"build-and-run-authentication-tests-openssl-1.0.1",
8989
"build-and-run-authentication-tests-openssl-1.0.2",
9090
"build-and-run-authentication-tests-openssl-1.1.0",
91-
"build-and-run-authentication-tests-openssl-1.0.1-fips",
92-
"build-and-run-authentication-tests-libressl-2.5",
93-
"build-and-run-authentication-tests-libressl-3.0-auto",
94-
"build-and-run-authentication-tests-libressl-3.0",
91+
"build-and-run-authentication-tests-openssl-1.0.1-fips"
9592
],
9693
{},
9794
),

.evergreen/scripts/build-and-test-with-toolchain.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ toolchain_base_dir="$(readlink -f /opt/mongo-c-toolchain)"
3535
declare toolchain_lib_dir="${toolchain_base_dir}/lib"
3636

3737
declare -a ssl_vers=(
38-
"libressl-2.5"
39-
"libressl-3.0"
4038
"openssl-1.0.1"
4139
"openssl-1.0.1-fips"
4240
"openssl-1.0.2"
@@ -60,11 +58,7 @@ for ssl_ver in "${ssl_vers[@]}"; do
6058
"${cmake_binary}" --version
6159

6260
declare ssl
63-
if [[ "${ssl_ver#*libressl}" != "${ssl_ver}" ]]; then
64-
ssl="LIBRESSL"
65-
else
66-
ssl="OPENSSL"
67-
fi
61+
ssl="OPENSSL"
6862

6963
declare output_file
7064
output_file="$(mktemp)"

.evergreen/scripts/install-ssl.sh

-15
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,6 @@ install_openssl_fips() {
8181
install_openssl
8282
}
8383

84-
install_libressl() {
85-
curl --retry 5 -o ssl.tar.gz "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${SSL}.tar.gz"
86-
tar zxf ssl.tar.gz
87-
pushd "${SSL}"
88-
(
89-
set -o xtrace
90-
./configure --prefix="${install_dir}"
91-
make -s -j "${njobs}" install
92-
) >/dev/null
93-
popd # "${SSL}"
94-
}
95-
9684
case "${SSL}" in
9785
openssl-*-fips)
9886
export LC_ALL
@@ -106,7 +94,4 @@ openssl-*)
10694
install_openssl
10795
;;
10896

109-
libressl-*)
110-
install_libressl
111-
;;
11297
esac

.evergreen/scripts/run-auth-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fi
6868

6969
# Archlinux (which we use for testing various self-installed OpenSSL versions)
7070
# stores their trust list under /etc/ca-certificates/extracted/.
71-
# We need to copy it to our custom installed OpenSSL/LibreSSL trust store.
71+
# We need to copy it to our custom installed OpenSSL trust store.
7272
declare pem_file="/etc/ca-certificates/extracted/tls-ca-bundle.pem"
7373
if [[ -f "${pem_file}" ]]; then
7474
[[ ! -d "${install_dir}" ]] || cp -v "${pem_file}" "${install_dir}/cert.pem"

CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,13 @@ mongo_bool_setting(USE_BUNDLED_UTF8PROC "Enable building with utf8proc. Needed f
112112
ADVANCED)
113113
mongo_setting(
114114
ENABLE_SSL [[Enable TLS connection and SCRAM authentication.]]
115-
OPTIONS WINDOWS DARWIN OPENSSL LIBRESSL OFF AUTO
115+
OPTIONS WINDOWS DARWIN OPENSSL OFF AUTO
116116
DEFAULT VALUE AUTO
117117
VALIDATE CODE [[
118118
if(ENABLE_SSL STREQUAL "DARWIN" AND NOT APPLE)
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")
124122
endif()
125123
]]
126124
)

Earthfile

-9
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,6 @@ multibuild:
161161
--sasl=Cyrus --sasl=off \
162162
--c_compiler=gcc --c_compiler=clang \
163163
--test_mongocxx_ref=master
164-
# Note: At time of writing, Ubuntu does not support LibreSSL, so run those
165-
# tests on a separate BUILD line that does not include Ubuntu:
166-
BUILD +run --targets "test-example" \
167-
--env=alpine3.16 --env=alpine3.17 --env=alpine3.18 --env=alpine3.19 \
168-
--env=archlinux \
169-
--tls=LibreSSL \
170-
--sasl=Cyrus --sasl=off \
171-
--c_compiler=gcc --c_compiler=clang \
172-
--test_mongocxx_ref=master
173164

174165
# release-archive :
175166
# Create a release archive of the source tree. (Refer to dev docs)

NEWS

+18-19
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ Unreleased (2.0.0)
88
was ignored.
99
* `bson_oid_init_sequence` is removed. Use `bson_oid_init` instead.
1010
* `mongoc_server_description_host` changes the return type from `mongoc_host_list_t *` to `const mongoc_host_list_t *`.
11+
* URI authentication credentials validation (only applicable during creation of a new `mongoc_uri_t` object from a connection string):
12+
* `authMechanism` is now validated and returns a client error for invalid or unsupported values.
13+
* `authSource` is now validated and returns a client error for invalid or unsupported values for the specified `authMechanism`.
14+
* `authSource` is now correctly defaulted to `"$external"` for MONGODB-AWS (instead of the database name or `"admin"`).
15+
* The requirement that a password is provided is now enforced when the authentication mechanism is specified for:
16+
* PLAIN
17+
* SCRAM-SHA-1
18+
* SCRAM-SHA-256
19+
* The requirement that neither or both a username and password is provided (optionally with a `AWS_SESSION_TOKEN`) is now enforced for MONGODB-AWS.
20+
* `authMechanismProperties` is now prohibited (instead of ignored) when the authentication mechanism is specified for:
21+
* PLAIN
22+
* SCRAM-SHA-1
23+
* SCRAM-SHA-256
24+
* MONGODB-X509
25+
* `authMechanismProperties` is now validated and returns a client error for invalid or unsupported fields when the authentication mechanism is specified for:
26+
* GSSAPI: supported fields are SERVICE_NAME, CANONICALIZE_HOST_NAME, SERVICE_REALM, and SERVICE_HOST.
27+
* MONGODB-AWS: supported fields are AWS_SESSION_TOKEN.
1128

1229
## Removals
1330

@@ -23,6 +40,7 @@ Unreleased (2.0.0)
2340
* `mongoc_cursor_is_alive` is removed. Use the equivalent `mongoc_cursor_more` instead.
2441
* `mongoc_collection_delete` is removed. Use `mongoc_collection_delete_one` or `mongoc_collection_delete_many` instead.
2542
* `mongoc_delete_flags_t` and `mongoc_reply_flags_t` are removed.
43+
* Support for LibreSSL (the CMake option `ENABLE_SSL=LIBRESSL`) is removed. Associated API is removed (`MONGOC_ENABLE_SSL_LIBRESSL` and `mongoc_stream_tls_libressl_new`).
2644

2745
### Forwarding headers (`#include <bson.h>` and `#include <mongoc.h>`)
2846

@@ -41,25 +59,6 @@ Instead, the names must be prefixed with the parent directory: `mongoc/mongoc.h`
4159
```
4260

4361

44-
Changes:
45-
46-
* URI authentication credentials validation (only applicable during creation of a new `mongoc_uri_t` object from a connection string):
47-
* `authMechanism` is now validated and returns a client error for invalid or unsupported values.
48-
* `authSource` is now validated and returns a client error for invalid or unsupported values for the specified `authMechanism`.
49-
* `authSource` is now correctly defaulted to `"$external"` for MONGODB-AWS (instead of the database name or `"admin"`).
50-
* The requirement that a password is provided is now enforced when the authentication mechanism is specified for:
51-
* PLAIN
52-
* SCRAM-SHA-1
53-
* SCRAM-SHA-256
54-
* The requirement that neither or both a username and password is provided (optionally with a `AWS_SESSION_TOKEN`) is now enforced for MONGODB-AWS.
55-
* `authMechanismProperties` is now prohibited (instead of ignored) when the authentication mechanism is specified for:
56-
* PLAIN
57-
* SCRAM-SHA-1
58-
* SCRAM-SHA-256
59-
* MONGODB-X509
60-
* `authMechanismProperties` is now validated and returns a client error for invalid or unsupported fields when the authentication mechanism is specified for:
61-
* GSSAPI: supported fields are SERVICE_NAME, CANONICALIZE_HOST_NAME, SERVICE_REALM, and SERVICE_HOST.
62-
* MONGODB-AWS: supported fields are AWS_SESSION_TOKEN.
6362

6463
libmongoc 1.30.2
6564
================

0 commit comments

Comments
 (0)