oatpp / oatpp-mbedtls Goto Github PK
View Code? Open in Web Editor NEWClient/Server Secure ConnectionProvider for oatpp applications. Based on MbedTLS.
Home Page: https://oatpp.io/
License: Apache License 2.0
Client/Server Secure ConnectionProvider for oatpp applications. Based on MbedTLS.
Home Page: https://oatpp.io/
License: Apache License 2.0
After building with the instructions, cmake in my project does not find the correct files for for compilation.
This is the error I recieve:
CMake Error at CMakeLists.txt:25 (find_package):
By not providing "Findoatpp-mbedtls.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"oatpp-mbedtls", but CMake did not find one.
Could not find a package configuration file provided by "oatpp-mbedtls"
(requested version 1.0.0) with any of the following names:
oatpp-mbedtlsConfig.cmake
oatpp-mbedtls-config.cmake
Add the installation prefix of "oatpp-mbedtls" to CMAKE_PREFIX_PATH or set
"oatpp-mbedtls_DIR" to a directory containing one of the above files. If
"oatpp-mbedtls" provides a separate development package or SDK, be sure it
has been installed.
I checked in my installation directory to see that the install created the above mentioned .cmake files
but could not find them.
Thanks
I'm not an ssl expert but i encountered this line in Config.cpp:
mbedtls_ssl_conf_authmode(&result->m_config, MBEDTLS_SSL_VERIFY_NONE);
Doesn't this mean that the client doesnt use ssl verification? Isnt that undesired behavior?
According to the mbedtls comments:
* \note On client, MBEDTLS_SSL_VERIFY_REQUIRED is the recommended mode.
I've successfully compiled this library against mbedtls 3.0.0 however a couple of very minor changes are required:
certs.h
does not exist in 3.0.0
Config.hpp
...
...
#ifndef oatpp_mbedtls_Config_hpp
#define oatpp_mbedtls_Config_hpp
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
#if MBEDTLS_VERSION_MAJOR < 3
#include "mbedtls/certs.h"
#endif
#include "mbedtls/x509.h"
#include "mbedtls/ssl.h"
...
...
mbedtls_pk_parse_keyfile
requires a rng
Config.cpp
...
...
...
std::shared_ptr<Config> Config::createDefaultServerConfigShared(const char* serverCertFile, const char* privateKeyFile, const char* pkPassword) {
auto result = createShared();
#if defined(OATPP_MBEDTLS_DEBUG)
mbedtls_ssl_conf_dbg( &result->m_config, mbedtlsDebug, (void*)"Server" );
mbedtls_debug_set_threshold( OATPP_MBEDTLS_DEBUG );
#endif
auto res = mbedtls_x509_crt_parse_file(&result->m_srvcert, serverCertFile);
if(res != 0) {
OATPP_LOGD("[oatpp::mbedtls::Config::createDefaultServerConfigShared()]", "Error. Can't parse serverCertFile path='%s', return value=%d", serverCertFile, res);
throw std::runtime_error("[oatpp::mbedtls::Config::createDefaultServerConfigShared()]: Error. Can't parse serverCertFile");
}
#if MBEDTLS_VERSION_MAJOR >= 3
res = mbedtls_pk_parse_keyfile(&result->m_privateKey, privateKeyFile, pkPassword, mbedtls_ctr_drbg_random, &result->m_ctr_drbg);
#else
res = mbedtls_pk_parse_keyfile(&result->m_privateKey, privateKeyFile, pkPassword);
#endif
if(res != 0)
...
...
...
NOTE: I haven't yet tested this, only got the build working.
Is support for mbedtls 3.0.0 something that could be added into the library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.