You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+51-23
Original file line number
Diff line number
Diff line change
@@ -927,7 +927,6 @@ TODO
927
927
* 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.
928
928
* add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
929
929
* add `stat` mode similar to [mod_lua](https://httpd.apache.org/docs/trunk/mod/mod_lua.html).
930
-
* cosocket: add client SSL certificate support.
931
930
932
931
[Back to TOC](#table-of-contents)
933
932
@@ -2948,7 +2947,7 @@ lua_ssl_ciphers
2948
2947
2949
2948
**context:***http, server, location*
2950
2949
2951
-
Specifies the enabled ciphers for requests to a SSL/TLS server in the [tcpsock:sslhandshake](#tcpsocksslhandshake) method. The ciphers are specified in the format understood by the OpenSSL library.
2950
+
Specifies the enabled ciphers for requests to a SSL/TLS server in the [tcpsock:tlshandshake](#tcpsocktlshandshake) method. The ciphers are specified in the format understood by the OpenSSL library.
2952
2951
2953
2952
The full list can be viewed using the “openssl ciphers” command.
2954
2953
@@ -2965,7 +2964,7 @@ lua_ssl_crl
2965
2964
2966
2965
**context:***http, server, location*
2967
2966
2968
-
Specifies a file with revoked certificates (CRL) in the PEM format used to verify the certificate of the SSL/TLS server in the [tcpsock:sslhandshake](#tcpsocksslhandshake) method.
2967
+
Specifies a file with revoked certificates (CRL) in the PEM format used to verify the certificate of the SSL/TLS server in the [tcpsock:tlshandshake](#tcpsocktlshandshake) method.
2969
2968
2970
2969
This directive was first introduced in the `v0.9.11` release.
2971
2970
@@ -2980,7 +2979,7 @@ lua_ssl_protocols
2980
2979
2981
2980
**context:***http, server, location*
2982
2981
2983
-
Enables the specified protocols for requests to a SSL/TLS server in the [tcpsock:sslhandshake](#tcpsocksslhandshake) method.
2982
+
Enables the specified protocols for requests to a SSL/TLS server in the [tcpsock:tlshandshake](#tcpsocktlshandshake) method.
2984
2983
2985
2984
The support for the `TLSv1.3` parameter requires version `v0.10.12`*and* OpenSSL 1.1.1.
2986
2985
@@ -2997,7 +2996,7 @@ lua_ssl_trusted_certificate
2997
2996
2998
2997
**context:***http, server, location*
2999
2998
3000
-
Specifies a file path with trusted CA certificates in the PEM format used to verify the certificate of the SSL/TLS server in the [tcpsock:sslhandshake](#tcpsocksslhandshake) method.
2999
+
Specifies a file path with trusted CA certificates in the PEM format used to verify the certificate of the SSL/TLS server in the [tcpsock:tlshandshake](#tcpsocktlshandshake) method.
3001
3000
3002
3001
This directive was first introduced in the `v0.9.11` release.
3003
3002
@@ -3289,6 +3288,7 @@ Nginx API for Lua
3289
3288
*[ngx.socket.tcp](#ngxsockettcp)
3290
3289
*[tcpsock:connect](#tcpsockconnect)
3291
3290
*[tcpsock:sslhandshake](#tcpsocksslhandshake)
3291
+
*[tcpsock:tlshandshake](#tcpsocktlshandshake)
3292
3292
*[tcpsock:send](#tcpsocksend)
3293
3293
*[tcpsock:receive](#tcpsockreceive)
3294
3294
*[tcpsock:receiveany](#tcpsockreceiveany)
@@ -7188,6 +7188,7 @@ Creates and returns a TCP or stream-oriented unix domain socket object (also kno
7188
7188
7189
7189
*[connect](#tcpsockconnect)
7190
7190
*[sslhandshake](#tcpsocksslhandshake)
7191
+
*[tlshandshake](#tcpsocktlshandshake)
7191
7192
*[send](#tcpsocksend)
7192
7193
*[receive](#tcpsockreceive)
7193
7194
*[close](#tcpsockclose)
@@ -7343,49 +7344,76 @@ This method was first introduced in the `v0.5.0rc1` release.
Does SSL/TLS handshake on the currently established connection.
7354
7355
7355
-
The optional `reused_session` argument can take a former SSL
7356
-
session userdata returned by a previous `sslhandshake`
7357
-
call for exactly the same target. For short-lived connections, reusing SSL
7356
+
An optional Lua table containing the following keys can be specified to this method as handshake options:
7357
+
7358
+
*`reused_session` take a former TLS
7359
+
session cdata returned by a previous `tlshandshake`
7360
+
call for exactly the same target. For short-lived connections, reusing TLS
7358
7361
sessions can usually speed up the handshake by one order by magnitude but it
7359
7362
is not so useful if the connection pool is enabled. This argument defaults to
7360
-
`nil`. If this argument takes the boolean `false` value, no SSL session
7361
-
userdata would return by this call and only a Lua boolean will be returned as
7362
-
the first return value; otherwise the current SSL session will
7363
+
`nil`. If this argument takes the boolean `false` value, no TLS session
7364
+
cdata would return by this call and only a Lua boolean will be returned as
7365
+
the first return value; otherwise the current TLS session will
7363
7366
always be returned as the first argument in case of successes.
7364
-
7365
-
The optional `server_name` argument is used to specify the server
7367
+
*`server_name` is used to specify the server
7366
7368
name for the new TLS extension Server Name Indication (SNI). Use of SNI can
7367
7369
make different servers share the same IP address on the server side. Also,
7368
-
when SSL verification is enabled, this `server_name` argument is
7370
+
when TLS verification is enabled (`options.verify` is `true`), this `server_name` argument is
7369
7371
also used to validate the server name specified in the server certificate sent from
7370
7372
the remote.
7371
-
7372
-
The optional `ssl_verify` argument takes a Lua boolean value to
7373
-
control whether to perform SSL verification. When set to `true`, the server
7373
+
*`verify` takes a Lua boolean value to
7374
+
control whether to perform TLS handshake verification. When set to `true`, the server
7374
7375
certificate will be verified according to the CA certificates specified by
7375
7376
the [lua_ssl_trusted_certificate](#lua_ssl_trusted_certificate) directive.
7376
7377
You may also need to adjust the [lua_ssl_verify_depth](#lua_ssl_verify_depth)
7377
7378
directive to control how deep we should follow along the certificate chain.
7378
-
Also, when the `ssl_verify` argument is true and the
7379
+
Also, when the `verify` argument is true and the
7379
7380
`server_name` argument is also specified, the latter will be used
7380
7381
to validate the server name in the server certificate.
7381
-
7382
-
The optional `send_status_req` argument takes a boolean that controls whether to send
7382
+
*`ocsp_status_req` takes a Lua boolean value that controls whether to send
7383
7383
the OCSP status request in the SSL handshake request (which is for requesting OCSP stapling).
7384
+
*`client_cert` specify a client certificate chain cdata object that will be used while handshaking with
7385
+
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)
7386
+
function provided by lua-resty-core. Note that specifying the `client_cert` option requires
7387
+
corresponding `client_priv_key` be provided too. See below.
7388
+
*`client_priv_key` specify a private key corresponds to the `client_cert` option above.
7389
+
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)
7390
+
function provided by lua-resty-core.
7391
+
7392
+
For code that does frequent calls to `tlshandshake`, the `options` table
7393
+
can be safely shared across requests as a module level variable (even if the call yields).
7384
7394
7385
7395
For connections that have already done SSL/TLS handshake, this method returns
7386
7396
immediately.
7387
7397
7388
-
This method was first introduced in the `v0.9.11` release.
7398
+
This method was first introduced in the `v0.10.16` release.
0 commit comments