🚸 Print errors if SSL_CTX failed
This commit is contained in:
parent
414341ebc6
commit
a1d17deb5f
1 changed files with 6 additions and 1 deletions
|
@ -49,9 +49,14 @@ int main() {
|
||||||
OPENSSL_init_ssl(0, nullptr);
|
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());
|
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) {
|
if (!ctx) {
|
||||||
cout << "Creation of SSL context failed" << endl;
|
cout << "Creation of SSL context failed: " << getCtxError() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load certificate
|
// Load certificate
|
||||||
|
|
Reference in a new issue