-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ngx.sleep() does not work in ssl_client_hello_by_lua* #438
Comments
We'll try to reproduce the problem |
Which http client are you using? I guess the client ended the SSL session abnormally. |
Sorry for being tardy here, it's been busy. Note that for the below I changed the config to prefix my sleep function with For testing right now, I'm running
For comparison, removing the sleep call yields:
|
Have you applied openresty/patches/nginx-1.25.1-ssl_client_hello_cb_yield.patch? |
I don't think that's among the patches the FreeBSD port ships with, so we'd have to update the port with that, int hat case. But is this the reason for the failure? There is no sleep happening, the failure is instant. |
Yes, it is the reason for the failre. I reproduced the problem and when I tried to fix it, I checked the patch file maintained by openresty and found it. |
It doesn't apply cleanly to 1.25.3 (it seems); and not on 1.24 either: $ cat work/nginx-1.24.0/src/event/ngx_event_openssl.c.rej
@@ -1712,6 +1712,9 @@
if (sslerr == SSL_ERROR_WANT_X509_LOOKUP
# ifdef SSL_ERROR_PENDING_SESSION
|| sslerr == SSL_ERROR_PENDING_SESSION
+# endif
+# ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB
+ || sslerr == SSL_ERROR_WANT_CLIENT_HELLO_CB
# endif
)
{ I can't find |
@ltning Sorry for the late reply as I've been busy settling in lately. I think the easiest way is to use nginx that comes in the openresty bundle which is fully patched |
Hey, no problem, thanks for returning to me on this. I'll give that a go; any idea when it'll be merged to an even-numbered nginx version? |
no idea :) |
It still doesn't work; behaviour is exactly the same as before. As a side note: I installed nginx-devel (1.25.3), which has but on startup I get:
I've checked base.lua around line 24, and added some debugging, and found that it needs to read |
I tested it and found that ssl patches can be installed successfully in this order. patch -p1 < ~/git/openresty/patches/nginx-1.25.1-ssl_cert_cb_yield.patch |
I found this bash script (openresty/util/mirror-tarballs) that uses this sequence to apply the ssl patches |
When trying to call ngx.sleep() in a
ssl_client_hello_by_lua_block
, the TCP connection is instantly dropped (FIN). Nginx built with --with-debug and --with-debuglog. Logs at end of report.OS: FreeBSD 13.2-RELEASE
Code:
Logs:
The text was updated successfully, but these errors were encountered: