Skip to content

Commit

Permalink
build: use static linking with OpenSSL on Windows (fluent#3193)
Browse files Browse the repository at this point in the history
Do not assume the existence of OpenSSL on Windows machines,
but rather includes it in the binary using static linking.

This fixes the issue "Fluent Bit fails to start up due to
missing libcrypto/libssl DLLs".

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
  • Loading branch information
fujimotos committed Mar 9, 2021
1 parent 2dfd703 commit f5166af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ if(FLB_TLS)
option(INSTALL_MBEDTLS_HEADERS OFF)
add_subdirectory(${FLB_PATH_LIB_MBEDTLS} EXCLUDE_FROM_ALL)

# Link OpenSSL statically on Windows.
if (FLB_SYSTEM_WINDOWS)
set(OPENSSL_USE_STATIC_LIBS ON)
set(OPENSSL_MSVC_STATIC_RT ON)
endif()

# find OpenSSL (our preferred choice now)
find_package(OpenSSL)
if(OPENSSL_FOUND)
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: v1-winbuild-{build}

image: Visual Studio 2017
image: Visual Studio 2019

platform:
- Win32
- x64

environment:
vspath: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community'
vspath: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community'
winflexbison: https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip
PATH: '%PATH%;C:\WinFlexBison'

Expand Down
4 changes: 2 additions & 2 deletions ci/do-ut.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cd build

if ( "x64" -eq $env:PLATFORM ) {
$OPENSSL_DIR = "C:\OpenSSL-v11-Win64"
$OPENSSL_DIR = "C:\OpenSSL-v111-Win64"
}
else {
$OPENSSL_DIR = "C:\OpenSSL-v11-Win32"
$OPENSSL_DIR = "C:\OpenSSL-v111-Win32"
}


Expand Down

0 comments on commit f5166af

Please sign in to comment.