Git Product home page Git Product logo

oatpp-mbedtls's Issues

My project cannot find cmake files

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

No ssl verification when using client

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.

Support mbedtls 3.0.0

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.