@@ -327,7 +327,7 @@ std::shared_ptr<SSLContext> newSSLServerContext(
327
327
{
328
328
ERR_error_string_n (ERR_get_error (), errbuf, sizeof (errbuf));
329
329
LOG_FATAL << " Reading certificate: " << errbuf;
330
- abort ( );
330
+ throw std::runtime_error ( " SSL_CTX_use_certificate_chain_file error. " );
331
331
}
332
332
r = SSL_CTX_use_PrivateKey_file (ctx->get (),
333
333
keyPath.c_str (),
@@ -336,14 +336,14 @@ std::shared_ptr<SSLContext> newSSLServerContext(
336
336
{
337
337
ERR_error_string_n (ERR_get_error (), errbuf, sizeof (errbuf));
338
338
LOG_FATAL << " Reading private key: " << errbuf;
339
- abort ( );
339
+ throw std::runtime_error ( " SSL_CTX_use_PrivateKey_file error " );
340
340
}
341
341
r = SSL_CTX_check_private_key (ctx->get ());
342
342
if (!r)
343
343
{
344
344
ERR_error_string_n (ERR_get_error (), errbuf, sizeof (errbuf));
345
345
LOG_FATAL << " Checking private key matches certificate: " << errbuf;
346
- abort ( );
346
+ throw std::runtime_error ( " SSL_CTX_check_private_key error " );
347
347
}
348
348
return ctx;
349
349
}
@@ -364,7 +364,7 @@ std::shared_ptr<SSLContext> newSSLClientContext(
364
364
{
365
365
ERR_error_string_n (ERR_get_error (), errbuf, sizeof (errbuf));
366
366
LOG_FATAL << " Reading certificate: " << errbuf;
367
- abort ( );
367
+ throw std::runtime_error ( " SSL_CTX_use_certificate_chain_file error. " );
368
368
}
369
369
r = SSL_CTX_use_PrivateKey_file (ctx->get (),
370
370
keyPath.c_str (),
@@ -373,14 +373,14 @@ std::shared_ptr<SSLContext> newSSLClientContext(
373
373
{
374
374
ERR_error_string_n (ERR_get_error (), errbuf, sizeof (errbuf));
375
375
LOG_FATAL << " Reading private key: " << errbuf;
376
- abort ( );
376
+ throw std::runtime_error ( " SSL_CTX_use_PrivateKey_file error. " );
377
377
}
378
378
r = SSL_CTX_check_private_key (ctx->get ());
379
379
if (!r)
380
380
{
381
381
ERR_error_string_n (ERR_get_error (), errbuf, sizeof (errbuf));
382
382
LOG_FATAL << " Checking private key matches certificate: " << errbuf;
383
- abort ( );
383
+ throw std::runtime_error ( " SSL_CTX_check_private_key error. " );
384
384
}
385
385
return ctx;
386
386
}
@@ -395,7 +395,7 @@ std::shared_ptr<SSLContext> newSSLServerContext(
395
395
const std::vector<std::pair<std::string, std::string>> &)
396
396
{
397
397
LOG_FATAL << " OpenSSL is not found in your system!" ;
398
- abort ( );
398
+ throw std::runtime_error ( " OpenSSL is not found in your system! " );
399
399
}
400
400
} // namespace trantor
401
401
#endif
@@ -513,7 +513,7 @@ void TcpConnectionImpl::startServerEncryption(
513
513
(void )callback;
514
514
515
515
LOG_FATAL << " OpenSSL is not found in your system!" ;
516
- abort ( );
516
+ throw std::runtime_error ( " OpenSSL is not found in your system! " );
517
517
#else
518
518
if (loop_->isInLoopThread ())
519
519
{
@@ -547,7 +547,7 @@ void TcpConnectionImpl::startClientEncryption(
547
547
(void )sslConfCmds;
548
548
549
549
LOG_FATAL << " OpenSSL is not found in your system!" ;
550
- abort ( );
550
+ throw std::runtime_error ( " OpenSSL is not found in your system! " );
551
551
#else
552
552
if (!hostname.empty ())
553
553
{
0 commit comments