Skip to content

Commit 83f7f89

Browse files
ngx_http_lua_ffi_balancer_set_ssl_ctx: Support openssl < 1.1.0
1 parent e2f2a8f commit 83f7f89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ngx_http_lua_balancer.c

+4
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,11 @@ ngx_http_lua_ffi_balancer_set_ssl_ctx(ngx_http_request_t *r,
802802
return NGX_OK;
803803
}
804804

805+
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
805806
if (!SSL_CTX_up_ref(ssl_ctx)) {
807+
#else
808+
if (CRYPTO_add(&ssl_ctx->references, 1, CRYPTO_LOCK_SSL_CTX) < 2) {
809+
#endif
806810
*err = "unable to take reference to SSL_CTX*";
807811
return NGX_ERROR;
808812
}

0 commit comments

Comments
 (0)