std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)> libssl_init_server_context(const TLSConfig& config,
std::map<int, std::string>& ocspResponses)
{
- auto ctx = std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>(SSL_CTX_new(SSLv23_server_method()), SSL_CTX_free);
+ auto ctx = std::unique_ptr<SSL_CTX, decltype(&SSL_CTX_free)>(SSL_CTX_new(SSLv23_server_method()), SSL_CTX_free);
if (!ctx) {
- ERR_print_errors_fp(stderr);
- throw std::runtime_error("Error creating an OpenSSL server context");
+ throw pdns::OpenSSL::error("Error creating an OpenSSL server context");
}
int sslOptions =