Skip to content

Unable to retrieve custom TLS extension in OpenResty #2425

Closed as duplicate
@limitcool

Description

@limitcool

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions