Skip to content

Commit bb76eb1

Browse files
tmthrgdagentzh
authored andcommitted
change: switched to SSL_version() calls from TLS1_get_version().
TLS1_get_version is a simple wrapper for SSL_version that returns 0 when used with DTLS. However, it was removed from BoringSSL in 2015 so instead use SSL_version directly. Note: BoringSSL is never an officially supported target for this module. ngx_http_lua_ffi_ssl_get_tls1_version can never be reached with DTLS so the behaviour is the same. Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
1 parent feae6e7 commit bb76eb1

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/ngx_http_lua_ssl_certby.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,6 @@ ngx_http_lua_ssl_cert_by_chunk(lua_State *L, ngx_http_request_t *r)
553553
int
554554
ngx_http_lua_ffi_ssl_get_tls1_version(ngx_http_request_t *r, char **err)
555555
{
556-
#ifndef TLS1_get_version
557-
558-
*err = "no TLS1 support";
559-
return NGX_ERROR;
560-
561-
#else
562-
563556
ngx_ssl_conn_t *ssl_conn;
564557

565558
if (r->connection == NULL || r->connection->ssl == NULL) {
@@ -573,11 +566,9 @@ ngx_http_lua_ffi_ssl_get_tls1_version(ngx_http_request_t *r, char **err)
573566
return NGX_ERROR;
574567
}
575568

576-
dd("tls1 ver: %d", (int) TLS1_get_version(ssl_conn));
577-
578-
return (int) TLS1_get_version(ssl_conn);
569+
dd("tls1 ver: %d", SSL_version(ssl_conn));
579570

580-
#endif
571+
return SSL_version(ssl_conn);
581572
}
582573

583574

0 commit comments

Comments
 (0)