Skip to content

Commit

Permalink
feat: add ngx_stream_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 af96930 commit d7794fd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/ngx_stream_lua_ssl_certby.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,4 +1603,27 @@ ngx_stream_lua_ffi_ssl_verify_client(ngx_stream_lua_request_t *r,
}


int
ngx_stream_lua_ffi_ssl_client_random(ngx_stream_lua_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_STREAM_SSL */

0 comments on commit d7794fd

Please sign in to comment.