Commit c63009c
authored
bugfix: remove sslhandshake result assert for pre-handshake errors. (#534)
When `tcpsock:sslhandshake()` fails before the actual SSL handshake starts,
`ngx_http_lua_ffi_socket_tcp_get_sslhandshake_result()` may return `FFI_OK`
while still providing the OpenSSL error details.
One example is a client private key setup failure. In that path, `rc` is
`FFI_ERROR`, but `u->error_ret` is not set,
so `ngx_http_lua_ffi_socket_tcp_get_sslhandshake_result` would return `FFI_OK`.
The existing `assert(res == FFI_ERROR)` turns this expected
error-reporting path into an assertion failure.
This patch removes the assertion so Lua can return the original SSL error to
the caller.1 parent cfb5825 commit c63009c
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
428 | | - | |
429 | 427 | | |
430 | | - | |
| 428 | + | |
431 | 429 | | |
432 | 430 | | |
433 | | - | |
434 | | - | |
435 | 431 | | |
436 | 432 | | |
437 | 433 | | |
| |||
443 | 439 | | |
444 | 440 | | |
445 | 441 | | |
| 442 | + | |
| 443 | + | |
446 | 444 | | |
447 | 445 | | |
448 | 446 | | |
| |||
0 commit comments