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
This directive runs user Lua code when Nginx is about to post-process the SSL server certificate message for the upstream SSL (https) connections.
3181
+
3182
+
It is particularly useful to parse upstream server certificate and do some custom operations in pure lua.
3183
+
3184
+
The [ngx.ssl.proxysslverify](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/proxysslverify.md) Lua modules provided by the [lua-resty-core](https://github.com/openresty/lua-resty-core/#readme)
local proxy_ssl_vfy = require "ngx.ssl.proxysslverify"
3206
+
local cert = proxy_ssl_vfy.get_verify_cert()
3207
+
3208
+
-- ocsp to verify cert
3209
+
-- check crl
3210
+
proxy_ssl_vfy.set_verify_result()
3211
+
...
3212
+
}
3213
+
}
3214
+
...
3215
+
}
3216
+
```
3217
+
3218
+
See more information in the [ngx.ssl.proxysslverify](https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/proxysslverify.md)
3219
+
Lua modules' official documentation.
3220
+
3221
+
Uncaught Lua exceptions in the user Lua code immediately abort the current SSL session, so does the
3222
+
[ngx.exit](#ngxexit) call with an error code like `ngx.ERROR`.
3223
+
3224
+
This Lua code execution context *does* support yielding, so Lua APIs that may yield
3225
+
(like cosockets, sleeping, and "light threads")
3226
+
are enabled in this context
3227
+
3228
+
Note, `ngx.ctx` in proxy_ssl_verify_by_lua_block is belonging to upstream connection, not downstream connection, so it's different from `ngx.ctx` in contexts like ssl_certificate_by_lua etc.
Equivalent to [proxy_ssl_verify_by_lua_block](#proxy_ssl_verify_by_lua_block), except that the file specified by `<path-to-lua-script-file>` contains the Lua code, or, as from the `v0.5.0rc32` release, the [LuaJIT bytecode](#luajit-bytecode-support) to be executed.
3244
+
3245
+
When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server.
3246
+
3247
+
[Back to TOC](#directives)
3248
+
3168
3249
lua_shared_dict
3169
3250
---------------
3170
3251
@@ -3499,6 +3580,21 @@ This directive was first introduced in the `v0.10.21` release.
When using proxy_ssl_verify_by_lua directive, `lua_upstream_skip_openssl_default_verify` controls whether to skip default openssl's verify function, that means using pure Lua code to verify upstream server certificate.
When using proxy_ssl_verify_by_lua directive, `lua_upstream_skip_openssl_default_verify` controls whether to skip default openssl's verify function, that means using pure Lua code to verify upstream server certificate.
2972
+
2973
+
This directive is turned <code>off</code> by default.
0 commit comments