Skip to content

Commit 804e981

Browse files
committed
Fix OpenSSL builds after new releases
1 parent a3c8a76 commit 804e981

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.evergreen/compile-unix.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ install_openssl_fips() {
4646
SSL=${SSL%-fips}
4747
}
4848
install_openssl () {
49-
curl --retry 5 -o ssl.tar.gz https://www.openssl.org/source/$SSL.tar.gz
49+
SSL_VERSION=${SSL##openssl-}
50+
tmp=$(echo $SSL_VERSION | tr . _)
51+
curl -L --retry 5 -o ssl.tar.gz https://github.com/openssl/openssl/archive/OpenSSL_${tmp}.tar.gz
5052
tar zxvf ssl.tar.gz
51-
cd $SSL
53+
cd openssl-OpenSSL_$tmp
5254
./config --prefix=$INSTALL_DIR $SSL_EXTRA_FLAGS shared -fPIC
5355
cpus=$(grep -c '^processor' /proc/cpuinfo)
56+
make -j32 || true
5457
make -j${cpus} || true
55-
make install_sw install_ssldirs || true
58+
make install || true
5659
cd ..
5760

5861
# x505_vfy.h has issues in 1.1.0e
@@ -63,6 +66,7 @@ install_openssl () {
6366
}
6467

6568
install_libressl () {
69+
SSL_VERSION=${SSL##libressl-}
6670
curl --retry 5 -o ssl.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/$SSL.tar.gz
6771
tar zxvf ssl.tar.gz
6872
cd $SSL
@@ -247,6 +251,9 @@ $SCAN_BUILD $CONFIGURE_SCRIPT $CONFIGURE_FLAGS
247251
export LD_LIBRARY_PATH=$EXTRA_LIB_PATH:$LD_LIBRARY_PATH
248252
export DYLD_LIBRARY_PATH=$EXTRA_LIB_PATH:$DYLD_LIBRARY_PATH
249253
openssl version
254+
if [ -n "$SSL_VERSION" ]; then
255+
openssl version | grep -q $SSL_VERSION
256+
fi
250257
# This should fail when using fips capable OpenSSL when fips mode is enabled
251258
openssl md5 README.rst || true
252259
$SCAN_BUILD make all

.evergreen/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6320,7 +6320,7 @@ tasks:
63206320
script: |
63216321
set -o errexit
63226322
set -o xtrace
6323-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.2k sh .evergreen/compile.sh
6323+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.0.2l sh .evergreen/compile.sh
63246324
- func: "run auth tests"
63256325
- func: "upload build"
63266326

@@ -6333,7 +6333,7 @@ tasks:
63336333
script: |
63346334
set -o errexit
63356335
set -o xtrace
6336-
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.1.0e sh .evergreen/compile.sh
6336+
DEBUG=yes CC='${CC}' MARCH='${MARCH}' SASL=no SSL=openssl-1.1.0f sh .evergreen/compile.sh
63376337
- func: "run auth tests"
63386338
- func: "upload build"
63396339

tests/test-mongoc-stream-tls.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ test_mongoc_tls_ip (void)
364364

365365

366366
#if !defined(__APPLE__) && !defined(_WIN32) && \
367-
defined(MONGOC_ENABLE_SSL_OPENSSL)
367+
defined(MONGOC_ENABLE_SSL_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x10000000L
368368
static void
369369
test_mongoc_tls_trust_dir (void)
370370
{
@@ -374,7 +374,7 @@ test_mongoc_tls_trust_dir (void)
374374
ssl_test_result_t cr;
375375

376376
sopt.pem_file = CERT_SERVER;
377-
sopt.ca_dir = CERT_CA;
377+
sopt.ca_file = CERT_CA;
378378

379379
copt.ca_dir = CERT_TEST_DIR;
380380

@@ -415,7 +415,7 @@ test_stream_tls_install (TestSuite *suite)
415415
#endif
416416

417417
#if !defined(__APPLE__) && !defined(_WIN32) && \
418-
defined(MONGOC_ENABLE_SSL_OPENSSL)
418+
defined(MONGOC_ENABLE_SSL_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x10000000L
419419
TestSuite_Add (suite, "/TLS/trust_dir", test_mongoc_tls_trust_dir);
420420
#endif
421421
#endif

0 commit comments

Comments
 (0)