Skip to content

oatpp/oatpp-libressl

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

oatpp-libressl oatpp build status

This submodule provides secure server and client connection providers for oatpp applications. Based on LibreSSL.

More about oat++:

Requires

LibreSSL installed.

Example

See: Full example project TLS-Libressl

Create server connection provider

#include "oatpp-libressl/server/ConnectionProvider.hpp"
#include "oatpp-libressl/Config.hpp"

...

const char* pemFile = "path/to/file.pem";
const char* crtFile = "path/to/file.crt";

auto config = oatpp::libressl::Config::createDefaultServerConfig(pemFile, crtFile);
auto connectionProvider = oatpp::libressl::server::ConnectionProvider::createShared(config, 8443);

Create client connection provider

#include "oatpp-libressl/client/ConnectionProvider.hpp"
#include "oatpp-libressl/Config.hpp"

...

auto config = oatpp::libressl::Config::createShared();
auto connectionProvider = oatpp::libressl::client::ConnectionProvider::createShared(config, "httpbin.org", 443);

Don't forget!

Set libressl lockingCallback and SIGPIPE handler on program start!

#include "oatpp-libressl/Callbacks.hpp"

...

/* set lockingCallback for libressl */
oatpp::libressl::Callbacks::setDefaultCallbacks();
#include <csignal>

...

/* ignore SIGPIPE */
std::signal(SIGPIPE, SIG_IGN);