Skip to content

Use SSL_client_hello_get0_ciphers() instead of SSL_get0_raw_cipherlist() #64

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

Open
climagabriel opened this issue May 6, 2025 · 4 comments

Comments

@climagabriel
Copy link

climagabriel commented May 6, 2025

You're already using up the clienthello callback to get the extensions. Why not get the ciphers offered up by the client in the clienthello packet with SSL_client_hello_get0_ciphers() while you're at it?
Not to mention that it would better conform to the definition of JA3 as a fingerprint of the clienthello packet, not of the negociated SSL session.

@fooinha
Copy link
Owner

fooinha commented May 6, 2025

@climagabriel , do you have a patch that does this?

@climagabriel
Copy link
Author

climagabriel commented May 6, 2025

I will. There's a lot more stuff I need to do in the clienthello callback so the only option for me is to move all this to lua and perform the ja3 calculation there, along with whatever else I need to do.

I've already moved the extensions extraction to lua:
openresty/lua-nginx-module@d1d5b73
openresty/lua-resty-core@fcef69d

And yeah I'm doing the rest of the fields as well.

@climagabriel
Copy link
Author

climagabriel commented May 6, 2025

nginx/nginx#562
The clienthello callback is set to become a point of contention more broadly though.
Several projects trying to use it for their purposes and OPENSSL only allows for one callback.

@climagabriel
Copy link
Author

climagabriel commented May 7, 2025

Btw, SSL_client_hello_get1_extensions_present already excludes all the GREASE extensions

openssl/openssl#27580

climagabriel added a commit to climagabriel/lua-nginx-module that referenced this issue May 7, 2025
Partially inspired by:
	https://github.com/naofumi0628/haproxy/blob/fefb9e37714bd2e3ad2adc3a321e165fc1dafae2/src/ssl_sock.c#L2252

Relevant:
	fooinha/nginx-ssl-ja3#64
        openssl/openssl#27580

And especially:
	https://github.com/openresty/lua-nginx-module#:~:text=after%20SSL%20handshake%2C-,the%20ngx.ctx%20created,-in%20ssl_certificate_by_lua*

It might be pointless for me to pull all this data into Lua-land if I don't find a way to store those values.
I need some kind of ngx.ctx but related not a request but to a ngx_ssl_connection_t, instead of a request.
climagabriel added a commit to climagabriel/lua-nginx-module that referenced this issue May 8, 2025
Partially inspired by:
	https://github.com/naofumi0628/haproxy/blob/fefb9e37714bd2e3ad2adc3a321e165fc1dafae2/src/ssl_sock.c#L2252

Relevant:
	fooinha/nginx-ssl-ja3#64
        openssl/openssl#27580

And especially:
	https://github.com/openresty/lua-nginx-module#:~:text=after%20SSL%20handshake%2C-,the%20ngx.ctx%20created,-in%20ssl_certificate_by_lua*

It might be pointless for me to pull all this data into Lua-land if I don't find a way to store those values.
I need some kind of ngx.ctx but related not a request but to a connection instead of a request.
climagabriel added a commit to climagabriel/lua-nginx-module that referenced this issue May 8, 2025
Partially inspired by:
	https://github.com/naofumi0628/haproxy/blob/fefb9e37714bd2e3ad2adc3a321e165fc1dafae2/src/ssl_sock.c#L2252

Relevant:
	fooinha/nginx-ssl-ja3#64
        openssl/openssl#27580

And especially:
	https://github.com/openresty/lua-nginx-module#:~:text=after%20SSL%20handshake%2C-,the%20ngx.ctx%20created,-in%20ssl_certificate_by_lua*

It might be pointless for me to pull all this data into Lua-land if I don't find a way to store those values.
I need some kind of ngx.ctx but related not a request but to a connection instead of a request.
climagabriel added a commit to climagabriel/lua-nginx-module that referenced this issue May 8, 2025
Partially inspired by:
	https://github.com/naofumi0628/haproxy/blob/fefb9e37714bd2e3ad2adc3a321e165fc1dafae2/src/ssl_sock.c#L2252

Relevant:
	fooinha/nginx-ssl-ja3#64
        openssl/openssl#27580

And especially:
	https://github.com/openresty/lua-nginx-module#:~:text=after%20SSL%20handshake%2C-,the%20ngx.ctx%20created,-in%20ssl_certificate_by_lua*

It might be pointless for me to pull all this data into Lua-land if I don't find a way to store those values.
I need some kind of ngx.ctx but related not a request but to a connection instead of a request.
climagabriel added a commit to climagabriel/nginx-ssl-ja3 that referenced this issue May 8, 2025
climagabriel added a commit to climagabriel/nginx-ssl-ja3 that referenced this issue May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants