|
978 | 978 | * 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.
|
979 | 979 | * add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
|
980 | 980 | * add `stat` mode similar to [mod_lua](https://httpd.apache.org/docs/trunk/mod/mod_lua.html).
|
981 |
| -* cosocket: add client SSL certificate support. |
982 | 981 |
|
983 | 982 | [Back to TOC](#table-of-contents)
|
984 | 983 |
|
@@ -3609,6 +3608,7 @@ Nginx API for Lua
|
3609 | 3608 | * [ngx.socket.stream](#ngxsocketstream)
|
3610 | 3609 | * [ngx.socket.tcp](#ngxsockettcp)
|
3611 | 3610 | * [tcpsock:connect](#tcpsockconnect)
|
| 3611 | +* [tcpsock:setclientcert](#tcpsocksetclientcert) |
3612 | 3612 | * [tcpsock:sslhandshake](#tcpsocksslhandshake)
|
3613 | 3613 | * [tcpsock:send](#tcpsocksend)
|
3614 | 3614 | * [tcpsock:receive](#tcpsockreceive)
|
@@ -7579,6 +7579,7 @@ ngx.socket.tcp
|
7579 | 7579 | 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:
|
7580 | 7580 |
|
7581 | 7581 | * [connect](#tcpsockconnect)
|
| 7582 | +* [setclientcert](#tcpsocksetclientcert) |
7582 | 7583 | * [sslhandshake](#tcpsocksslhandshake)
|
7583 | 7584 | * [send](#tcpsocksend)
|
7584 | 7585 | * [receive](#tcpsockreceive)
|
@@ -7738,6 +7739,31 @@ This method was first introduced in the `v0.5.0rc1` release.
|
7738 | 7739 |
|
7739 | 7740 | [Back to TOC](#nginx-api-for-lua)
|
7740 | 7741 |
|
| 7742 | +tcpsock:setclientcert |
| 7743 | +-------------------- |
| 7744 | + |
| 7745 | +**syntax:** *ok, err = tcpsock:setclientcert(cert, pkey)* |
| 7746 | + |
| 7747 | +**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** |
| 7748 | + |
| 7749 | +Set client certificate chain and corresponding private key to the TCP socket object. |
| 7750 | +The certificate chain and private key provided will be used later by the [tcpsock:sslhandshake](#tcpsocksslhandshake) method. |
| 7751 | + |
| 7752 | +* `cert` specify a client certificate chain cdata object that will be used while handshaking with |
| 7753 | +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) |
| 7754 | +function provided by lua-resty-core. Note that specifying the `cert` option requires |
| 7755 | +corresponding `pkey` be provided too. See below. |
| 7756 | +* `pkey` specify a private key corresponds to the `cert` option above. |
| 7757 | +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) |
| 7758 | +function provided by lua-resty-core. |
| 7759 | + |
| 7760 | +If both of `cert` and `pkey` are `nil`, this method will clear any existing client certificate and private key |
| 7761 | +that was previously set on the cosocket object. |
| 7762 | + |
| 7763 | +This method was first introduced in the `v0.10.22` release. |
| 7764 | + |
| 7765 | +[Back to TOC](#nginx-api-for-lua) |
| 7766 | + |
7741 | 7767 | tcpsock:sslhandshake
|
7742 | 7768 | --------------------
|
7743 | 7769 |
|
|
0 commit comments