Skip to content

Commit

Permalink
ngx_http_lua_ffi_balancer_set_ssl_ctx: Support openssl < 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
james-callahan committed Jun 4, 2018
1 parent 693a9c1 commit e04bb58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ngx_http_lua_balancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,11 @@ ngx_http_lua_ffi_balancer_set_ssl_ctx(ngx_http_request_t *r,
return NGX_OK;
}

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
if (!SSL_CTX_up_ref(ssl_ctx)) {
#else
if (CRYPTO_add(&ssl_ctx->references, 1, CRYPTO_LOCK_SSL_CTX) < 2) {
#endif
*err = "unable to take reference to SSL_CTX*";
return NGX_ERROR;
}
Expand Down

0 comments on commit e04bb58

Please sign in to comment.