Closed hhashoww closed 2 years ago
Update:
I solved my problem by switching the order in the "CMakeLists.txt"
${oatpp-openssl}
${oatpp}
But when I start my server, the error message is:
terminate called after throwing an instance of 'std::runtime_error'
what(): [oatpp::openssl::configurer::CertificateChainFile::configure()]: Error. Call to 'SSL_CTX_use_certificate_chain_file' failed.
I use the certificate keys in the https://github.com/oatpp/example-libressl/tree/master/cert is that OK?
Oops!
I made a typo for my certificate filename
I think this ticket can be closed
I'm using MSYS2 on windows environment So the OpenSSL::Crypto & OpenSSL::SSL are from MSYS2 package server And I use MinGW to build the oatpp-openssl related libraries for my project
This is my CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(HttpServer LANGUAGES CXX)
## add executable
add_executable(${PROJECT_NAME}
src/app_component.hpp
src/controller/controller.cpp
src/controller/controller.hpp
src/dto/dtos.hpp
src/app.cpp
)
## For windows only
if(CMAKE_HOST_WIN32)
set(ADDITIONAL_LIBS ws2_32)
find_library(oatpp NAMES liboatpp.a HINTS ${PROJECT_SOURCE_DIR}/lib/win64)
if(NOT oatpp)
message(FATAL_ERROR "Library liboatpp was not found!")
endif()
find_library(oatpp-openssl NAMES liboatpp-openssl.a HINTS ${PROJECT_SOURCE_DIR}/lib/win64)
if(NOT oatpp-openssl)
message(FATAL_ERROR "Library liboatpp-openssl was not found!")
endif()
find_library(oatpp-test NAMES liboatpp-test.a HINTS ${PROJECT_SOURCE_DIR}/lib/win64)
if(NOT oatpp-test)
message(FATAL_ERROR "Library liboatpp-test was not found!")
endif()
endif()
# From MSYS2
find_package(OpenSSL REQUIRED)
target_link_libraries(${PROJECT_NAME}
PUBLIC
${oatpp-openssl}
${oatpp}
# must be last in the command
OpenSSL::SSL
OpenSSL::Crypto
)
target_include_directories(${PROJECT_NAME}
PUBLIC
src
${PROJECT_SOURCE_DIR}/include
INTERFACE
${PROJECT_SOURCE_DIR}/
)
Hi,
I'd like to use OpenSSL to replace Libressl but I cannot find the right way to integrate oatpp-openssl module into my oat++ project is there any example project just like https://github.com/oatpp/example-libressl??
AppComponent.hpp
App.cpp
And I got the following compiling errors
thank you :)