| 1907 | |
| 1908 | #ifdef CPPHTTPLIB_OPENSSL_SUPPORT |
| 1909 | class SSLServer : public Server { |
| 1910 | public: |
| 1911 | SSLServer(const char *cert_path, const char *private_key_path, |
| 1912 | const char *client_ca_cert_file_path = nullptr, |
| 1913 | const char *client_ca_cert_dir_path = nullptr, |
| 1914 | const char *private_key_password = nullptr); |
| 1915 | |
| 1916 | SSLServer(X509 *cert, EVP_PKEY *private_key, |
| 1917 | X509_STORE *client_ca_cert_store = nullptr); |
| 1918 | |
| 1919 | SSLServer( |
| 1920 | const std::function<bool(SSL_CTX &ssl_ctx)> &setup_ssl_ctx_callback); |
| 1921 | |
| 1922 | ~SSLServer() override; |
| 1923 | |
| 1924 | bool is_valid() const override; |
| 1925 | |
| 1926 | SSL_CTX *ssl_context() const; |
| 1927 | |
| 1928 | void update_certs(X509 *cert, EVP_PKEY *private_key, |
| 1929 | X509_STORE *client_ca_cert_store = nullptr); |
| 1930 | |
| 1931 | private: |
| 1932 | bool process_and_close_socket(socket_t sock) override; |
| 1933 | |
| 1934 | SSL_CTX *ctx_; |
| 1935 | std::mutex ctx_mutex_; |
| 1936 | }; |
| 1937 | |
| 1938 | class SSLClient final : public ClientImpl { |
| 1939 | public: |
nothing calls this directly
no outgoing calls
no test coverage detected