|
977 | 977 | * add `ignore_resp_headers`, `ignore_resp_body`, and `ignore_resp` options to [ngx.location.capture](#ngxlocationcapture) and [ngx.location.capture_multi](#ngxlocationcapture_multi) methods, to allow micro performance tuning on the user side.
|
978 | 978 | * add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
|
979 | 979 | * add `stat` mode similar to [mod_lua](https://httpd.apache.org/docs/trunk/mod/mod_lua.html).
|
980 |
| -* cosocket: add client SSL certificate support. |
981 | 980 |
|
982 | 981 | [Back to TOC](#table-of-contents)
|
983 | 982 |
|
@@ -3594,6 +3593,7 @@ Nginx API for Lua
|
3594 | 3593 | * [ngx.socket.stream](#ngxsocketstream)
|
3595 | 3594 | * [ngx.socket.tcp](#ngxsockettcp)
|
3596 | 3595 | * [tcpsock:connect](#tcpsockconnect)
|
| 3596 | +* [tcpsock:setclientcert](#tcpsocksetclientcert) |
3597 | 3597 | * [tcpsock:sslhandshake](#tcpsocksslhandshake)
|
3598 | 3598 | * [tcpsock:send](#tcpsocksend)
|
3599 | 3599 | * [tcpsock:receive](#tcpsockreceive)
|
@@ -7564,6 +7564,7 @@ ngx.socket.tcp
|
7564 | 7564 | Creates and returns a TCP or stream-oriented unix domain socket object (also known as one type of the "cosocket" objects). The following methods are supported on this object:
|
7565 | 7565 |
|
7566 | 7566 | * [connect](#tcpsockconnect)
|
| 7567 | +* [setclientcert](#tcpsocksetclientcert) |
7567 | 7568 | * [sslhandshake](#tcpsocksslhandshake)
|
7568 | 7569 | * [send](#tcpsocksend)
|
7569 | 7570 | * [receive](#tcpsockreceive)
|
@@ -7723,6 +7724,31 @@ This method was first introduced in the `v0.5.0rc1` release.
|
7723 | 7724 |
|
7724 | 7725 | [Back to TOC](#nginx-api-for-lua)
|
7725 | 7726 |
|
| 7727 | +tcpsock:setclientcert |
| 7728 | +-------------------- |
| 7729 | + |
| 7730 | +**syntax:** *ok, err = tcpsock:setclientcert(cert, pkey)* |
| 7731 | + |
| 7732 | +**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua*, ngx.timer.*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_client_hello_by_lua** |
| 7733 | + |
| 7734 | +Set client certificate chain and corresponding private key to the TCP socket object. |
| 7735 | +The certificate chain and private key provided will be used later by the [tcpsock:sslhandshake](#tcpsocksslhandshake) method. |
| 7736 | + |
| 7737 | +* `cert` specify a client certificate chain cdata object that will be used while handshaking with |
| 7738 | +remote server. These objects can be created using [ngx.ssl.parse\_pem\_cert](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl.md#parse_pem_cert) |
| 7739 | +function provided by lua-resty-core. Note that specifying the `cert` option requires |
| 7740 | +corresponding `pkey` be provided too. See below. |
| 7741 | +* `pkey` specify a private key corresponds to the `cert` option above. |
| 7742 | +These objects can be created using [ngx.ssl.parse\_pem\_priv\_key](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl.md#parse_pem_priv_key) |
| 7743 | +function provided by lua-resty-core. |
| 7744 | + |
| 7745 | +If both of `cert` and `pkey` are `nil`, this method will clear any existing client certificate and private key |
| 7746 | +that was previously set on the cosocket object. |
| 7747 | + |
| 7748 | +This method was first introduced in the `v0.10.22` release. |
| 7749 | + |
| 7750 | +[Back to TOC](#nginx-api-for-lua) |
| 7751 | + |
7726 | 7752 | tcpsock:sslhandshake
|
7727 | 7753 | --------------------
|
7728 | 7754 |
|
|
0 commit comments