Skip to content

Commit

Permalink
feat: add ngx_http_lua_ffi_ssl_client_random.
Browse files Browse the repository at this point in the history
Signed-off-by: xuruidong <[email protected]>
  • Loading branch information
xuruidong committed Feb 25, 2024
1 parent 7598ff3 commit fbb45b9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/ngx_http_lua_ssl_certby.c
Original file line number Diff line number Diff line change
Expand Up @@ -1609,4 +1609,27 @@ ngx_http_lua_ffi_get_req_ssl_pointer(ngx_http_request_t *r)
}


int
ngx_http_lua_ffi_ssl_client_random(ngx_http_request_t *r,
unsigned char *out, size_t *outlen, char **err)
{
ngx_ssl_conn_t *ssl_conn;

if (r->connection == NULL || r->connection->ssl == NULL) {
*err = "bad request";
return NGX_ERROR;
}

ssl_conn = r->connection->ssl->connection;
if (ssl_conn == NULL) {
*err = "bad ssl conn";
return NGX_ERROR;
}

*outlen = SSL_get_client_random(ssl_conn, out, *outlen);

return NGX_OK;
}


#endif /* NGX_HTTP_SSL */

0 comments on commit fbb45b9

Please sign in to comment.