Skip to content

Commit 5d5329f

Browse files
committed
CDRIVER-2165 Ensure fallback to sspi/schannel works
On Windows, OpenSSL and Cyrus SASL are unlikely to be available. By default, we'll fallback to compiling against SSPI/Schannel which is always available on Windows.
1 parent 8cbbd96 commit 5d5329f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ if (NOT ENABLE_SSL STREQUAL OFF)
450450
)
451451

452452
if (OPENSSL_FOUND)
453+
message (STATUS "Compiling against OpenSSL")
453454
set (SOURCES ${SOURCES}
454455
${SOURCE_DIR}/src/mongoc/mongoc-crypto-openssl.c
455456
${SOURCE_DIR}/src/mongoc/mongoc-rand-openssl.c
@@ -463,6 +464,7 @@ if (NOT ENABLE_SSL STREQUAL OFF)
463464
set(SSL_LIBS ${SSL_LIBS} crypt32.lib)
464465
endif()
465466
elseif (SECURE_TRANSPORT)
467+
message (STATUS "Compiling against Secure Transport")
466468
set (SOURCES ${SOURCES}
467469
${SOURCE_DIR}/src/mongoc/mongoc-crypto-common-crypto.c
468470
${SOURCE_DIR}/src/mongoc/mongoc-rand-common-crypto.c
@@ -471,6 +473,7 @@ if (NOT ENABLE_SSL STREQUAL OFF)
471473
)
472474
set (SSL_LIBS "-framework CoreFoundation -framework Security")
473475
elseif (SECURE_CHANNEL)
476+
message (STATUS "Compiling against Secure Channel")
474477
set (SOURCES ${SOURCES}
475478
${SOURCE_DIR}/src/mongoc/mongoc-crypto-cng.c
476479
${SOURCE_DIR}/src/mongoc/mongoc-rand-cng.c
@@ -479,6 +482,7 @@ if (NOT ENABLE_SSL STREQUAL OFF)
479482
)
480483
set(SSL_LIBS secur32.lib crypt32.lib Bcrypt.lib)
481484
elseif (LIBRESSL)
485+
message (STATUS "Compiling against LibreSSL")
482486
set (SOURCES ${SOURCES}
483487
${SOURCE_DIR}/src/mongoc/mongoc-crypto-openssl.c
484488
${SOURCE_DIR}/src/mongoc/mongoc-rand-openssl.c
@@ -487,6 +491,8 @@ if (NOT ENABLE_SSL STREQUAL OFF)
487491
)
488492
set(SSL_LIBS -ltls -lcrypto)
489493
endif ()
494+
else ()
495+
message (STATUS "SSL disabled")
490496
endif () # ENABLE_SSL
491497

492498

@@ -500,8 +506,10 @@ if (MONGOC_ENABLE_SASL)
500506
message (STATUS "Compiling against Windows SSPI")
501507
set (SOURCES ${SOURCES} ${SOURCE_DIR}/src/mongoc/mongoc-cluster-sspi.c)
502508
set (SOURCES ${SOURCES} ${SOURCE_DIR}/src/mongoc/mongoc-sspi.c)
503-
set (SASL_LIBS ${SASL_LIBS} secur32.lib crypt32.lib Shlwapi.lib)
509+
set (SASL_LIBS secur32.lib crypt32.lib Shlwapi.lib)
504510
endif()
511+
else()
512+
message (STATUS "SASL disabled")
505513
endif()
506514

507515
add_library(mongoc_shared SHARED ${SOURCES} ${HEADERS})

0 commit comments

Comments
 (0)