https://github.com/oatpp/oatpp-libressl
oatpp secure ConnectionProvider based on libressl
https://github.com/oatpp/oatpp-libressl
c-plus-plus cpp https-server libressl oatpp
Last synced: 9 months ago
JSON representation
oatpp secure ConnectionProvider based on libressl
- Host: GitHub
- URL: https://github.com/oatpp/oatpp-libressl
- Owner: oatpp
- License: apache-2.0
- Created: 2018-06-22T21:29:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-25T06:01:22.000Z (over 1 year ago)
- Last Synced: 2024-10-29T22:52:07.692Z (about 1 year ago)
- Topics: c-plus-plus, cpp, https-server, libressl, oatpp
- Language: C++
- Homepage: https://oatpp.io/
- Size: 221 KB
- Stars: 4
- Watchers: 6
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oatpp-libressl [](https://dev.azure.com/lganzzzo/lganzzzo/_build?definitionId=3)
This submodule provides secure server and client connection providers for oatpp applications. Based on LibreSSL.
More about oat++:
- Website: [https://oatpp.io](https://oatpp.io)
## Requires
LibreSSL installed.
## Example
See: [Full example project TLS-Libressl](https://github.com/oatpp/example-libressl)
### Create server connection provider
```c++
#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
```c++
#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!
```c++
#include "oatpp-libressl/Callbacks.hpp"
...
/* set lockingCallback for libressl */
oatpp::libressl::Callbacks::setDefaultCallbacks();
```
```c++
#include
...
/* ignore SIGPIPE */
std::signal(SIGPIPE, SIG_IGN);
```