openresty / lua-resty-core

New FFI-based API for lua-nginx-module
801 stars 272 forks source link

I want to get all the extension information of client hello, not just server name , what can I do? #410

Open ggboss opened 1 year ago

ggboss commented 1 year ago

local ssl_clt = require "ngx.ssl.clienthello" local ext = ssl_clt.get_client_hello_ext(0)

The ext_type represented by 0 is server name, is there any other ext_type?

I want to get supported_groups and ec_point_formats.

oowl commented 1 year ago

You can refer to this function https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.lua#L145 to write your own function

ggboss commented 1 year ago

I don't know what types are supported by ext_type, I don't see the definition anywhere

The source code has been traced back to the openssl SSL_client_hello_get0_ext()

I guess calling get_client_hello_ext() and passing in ext_type will get the supported_groups information, but I don't see what ext_type supported_groups belong to

oowl commented 1 year ago

I can not find type define in OpenSSl doc, But I used Wireshark's packet hexdump see it, Maybe you can use wireshark to debug.

image
ggboss commented 1 year ago

Thank friend, I'll debug again for a while

ggboss commented 1 year ago

hope someone proposes a good solution

xuruidong commented 4 months ago

https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml