Skip to content
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

Consider adding MarshalJson support for ClientHelloSpec #245

Open
let4be opened this issue Sep 13, 2023 · 5 comments
Open

Consider adding MarshalJson support for ClientHelloSpec #245

let4be opened this issue Sep 13, 2023 · 5 comments
Labels
good idea Feature is recognized as valuable help wanted Calling for community PR/volunteer

Comments

@let4be
Copy link

let4be commented Sep 13, 2023

Hi!
Looks like utls can unmarshal ClientHelloSpec from client.tlsfingerprint.io format

Could be useful to support marshalling/unmarshalling to/from arbitrary json, or at least marshalling to client.tlsfingerprint.io format

@gaukas
Copy link
Contributor

gaukas commented Sep 14, 2023

Actually JSON import/export was a planned feature. But currently only partially completed due to my limited capacity. I want to clarify that it is not abandoned or deserted, but still "coming soon".

client.tlsfingerprint.io format

I would love to point out that client.tlsfingerprint.io currently does not parse enough details and what's provided there could be less than enough to rebuild a complete ClientHelloSpec when a few new extensions are included (PSK, ALPS, etc). You can see in testdata we have some pre-built JSON which does not look like the response from client.tlsfingerprint.io. Those are actually the proposed JSON ClientHelloSpec.

@gaukas
Copy link
Contributor

gaukas commented Sep 14, 2023

With that said, I guess we all would be happy to see if anyone volunteers to take over the development of this feature.

@gaukas gaukas added help wanted Calling for community PR/volunteer good idea Feature is recognized as valuable labels Sep 14, 2023
@let4be
Copy link
Author

let4be commented Sep 14, 2023

Do we need to keep compatibility with client.tlsfingerprint.io?
It's json and would complicate adding normal readable json support(current impl of client.tlsfingerprint.io expects binary data in extensions ) afaik

@gaukas
Copy link
Contributor

gaukas commented Sep 14, 2023

Importing from client.tlsfingerprint.io was (supposed to be) done by (*ClientHelloSpec).ImportTLSClientHello. It will no longer work now given the client.tlsfingerprint.io has been changed (moved to use clienthellod), but the corresponding updates are welcome.

But again clienthellod doesn't capture every single details in the clienthello either so I doubt if you can really build a complete ClientHelloSpec from what you see on client.tlsfingerprint.io.

@gaukas
Copy link
Contributor

gaukas commented Sep 14, 2023

So, in short, no. JSON here does not refer to client.tlsfingerprint.io, and should not be compatible with it. The original plan is building a JSON-exporter to replace the old UTLS code generator on tlsfingerprint.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good idea Feature is recognized as valuable help wanted Calling for community PR/volunteer
Projects
None yet
Development

No branches or pull requests

2 participants