Skip to content

Commit c8c469b

Browse files
committed
Merge r1916054 from trunk:
mod_ssl: Check SSL_CTX_new() return value SSL_CTX_new() will return NULL if there was an error creating a new SSL context. Submitted by: StephenWall Github: closes #402 Reviewed by: jailletc36, rjung, jorton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1923248 13f79535-47bb-0310-9956-ffa450edef68
1 parent 000cd22 commit c8c469b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Changes with Apache 2.4.63
44
*) mod_cache_socache: Fix possible crash on error path. PR 69358.
55
[Ruediger Pluem]
66

7+
*) mod_ssl: Fail cleanly at startup if OpenSSL initialization fails.
8+
[StephenWall]
9+
710
*) mod_md: update to version 2.4.31
811
- Improved error reporting when waiting for ACME server to verify domains
912
or finalizing the order fails, e.g. times out.

modules/ssl/ssl_engine_init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,11 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
692692
TLS_server_method(); /* server */
693693
#endif
694694
ctx = SSL_CTX_new(method);
695+
if (ctx == NULL) {
696+
/* Can fail for some system/install mis-configuration. */
697+
ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, s);
698+
return ssl_die(s);
699+
}
695700

696701
mctx->ssl_ctx = ctx;
697702

0 commit comments

Comments
 (0)