]> WPIA git - cassiopeia.git/blob - src/sslUtil.h
fix: clean SSL shutdown, reset, allowing deamon operation
[cassiopeia.git] / src / sslUtil.h
1 #pragma once
2 #include <openssl/ssl.h>
3 #include <memory>
4 #include <string>
5
6 struct Profile {
7     std::string cert;
8     std::string key;
9     std::string eku;
10     std::string ku;
11
12     std::shared_ptr<X509> ca;
13     std::shared_ptr<EVP_PKEY> caKey;
14 };
15
16 extern std::shared_ptr<int> ssl_lib_ref;
17
18 std::shared_ptr<X509> loadX509FromFile( std::string filename );
19 std::shared_ptr<EVP_PKEY> loadPkeyFromFile( std::string filename );
20
21 std::shared_ptr<SSL_CTX> generateSSLContext( bool server );
22 std::shared_ptr<BIO> openSerial( const std::string name );