lua-resty-core icon indicating copy to clipboard operation
lua-resty-core copied to clipboard

Unable to retrieve custom TLS extension in OpenResty

Open limitcool opened this issue 8 months ago • 0 comments

Environment
OpenResty Version: openresty/1.27.1.2

Problem

The Lua API ngx.ssl.clienthello.get_client_hello_ext(0x4D59) always returns nil, even though:
Wireshark confirms the extension 0x4D59 is present in the Client Hello's "Outer Extensions" section.

Image

Standard extensions (e.g., SNI type 0) are retrieved successfully using the same API.

Configuration Snippet:

ssl_client_hello_by_lua_block {  
  local ssl_clt = require "ngx.ssl.clienthello"  
  local custom_ext = ssl_clt.get_client_hello_ext(0x4D59)  -- Always nil  
  if custom_ext then  
    ngx.log(ngx.INFO, "Got extension 0x4D59")  
  else  
    ngx.log(ngx.INFO, "Extension 0x4D59 not found")  -- Always triggered  
  end  

Log Output:
Extension 0x4D59 not found

limitcool avatar Jun 04 '25 07:06 limitcool