From a1d17deb5f52636cd4abeed732d3778b7877f2a1 Mon Sep 17 00:00:00 2001 From: "Simon V. Lejel" Date: Mon, 12 Feb 2024 17:54:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Print=20errors=20if=20SSL=5FCTX?= =?UTF-8?q?=20failed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/main.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/main.cc b/src/server/main.cc index 95a43e6..f3031da 100644 --- a/src/server/main.cc +++ b/src/server/main.cc @@ -49,9 +49,14 @@ int main() { OPENSSL_init_ssl(0, nullptr); } + // Create new SSL context with server side connections and save it to a + // pointer SSL_CTX *ctx = SSL_CTX_new(TLS_server_method()); + + // Check of the context is null + // If it's null, then an error occurred if (!ctx) { - cout << "Creation of SSL context failed" << endl; + cout << "Creation of SSL context failed: " << getCtxError() << endl; } // Load certificate