-
Notifications
You must be signed in to change notification settings - Fork 244
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
utls unconditionally sets SessionID in all ClientHellos #32
Comments
I did some manual testing, and it seems that popular browsers still generate a 32 byte SessionID, even when they don't have a ticket. The sessionID-less ClientHello you are trying to mimic: is it popular? SessionID mechanism predates session tickets, and there are valid ClientHello messages that have SessionID, but not the ticket. Therefore "set session ID if and only if session ticket is set" may not to be the policy we want. Or maybe it is: more pcaps with captures of popular sessionID-less TLS implementations will help make a decision. The less knobs uTLS has, easier it is to use, and I think we should strive to prevent uTLS users from shooting themselves in the foot. Ideally, users would not be required to specify whether or not their ClientHello should include SessionID, and the uTLS still should try to demonstrate a behavior that is common in the wild(perhaps based on TLS version and extensions), so finding a good default would be incredibly useful here.
Unfortunately, no.
You should be able to |
It's an older TLS 1.2 ClientHello. In a certain adversarial context, it appears to be more successful than the utls ClientHellos. We don't have much information about popularity.
That's true. Although, hypothetically, could an adversary block all TLS 1.2 flows with ClientHellos containing a non-empty SessionID and the result would be: entirely block all TLS 1.2 clients that unconditionally include a SessionID; and just degrade performance for TLS 1.2 clients that fall back to full handshake and omit the SessionID by default when not resuming?
Thanks. I tested that and it does what we need. It ends up making our code a bit more complex than what I'd imagined with I'll rename this issue since "Unable to construct a parrot that omits SessionID" is not the case. I won't close it yet, in case you think that the question about how common SessionID is in non-resuming TLS 1.2 flows warrants further consideration. |
OkHttp(the most popular java http client library) on Android sets an empty session id when it doesn't have one. I think this library should support the mimicking in an easier way. |
While attempting to construct a TLS 1.2 parrot that omits the SessionID, I have observed via packet capture that
utls
always sends a SessionID in the ClientHello, regardless of whether a session ticket is attached.I believe this is due to changes in the upstream
crypto/tls
when TLS 1.3 support was added.As far as I understand it,
utls
callsmakeClientHello
here, and uses the results as the base ClientHello:utls/u_parrots.go
Lines 494 to 500 in 4da6795
Here's where the current
makeClientHello
, fromcrypto/tls
, unconditionally sets the SessionID:utls/handshake_client.go
Lines 111 to 116 in 4da6795
This is probably desired for TLS 1.3 parrots, as my brief testing shows similar behavior in at least one browser ("compatibility" mode).
In older
crypto/tls
andutls
,makeClientHello
doesn't have this unconditional code block and the SessionID is set conditionally, when there's a session ticket, here:utls/handshake_client.go
Lines 150 to 159 in 03d875d
Has the on-the-wire format of parrots such as
HelloIOS_11_1
changed sinceutls
was upgraded to support TLS 1.3?Of the bundled TLS 1.2 parrots, I can't tell whether the SessionID should or should not be set when there is no session ticket. I didn't find any stats regarding SessionID here, https://tlsfingerprint.io. Is this information in your raw database?
With the existing API, I don't see how to create a parrot that omits the SessionID. It appears not difficult to implement, as something like this can be added after the
makeClientHello
call inApplyPreset
:NoDefaultSessionID
would be a newClientHelloSpec
boolean field that defaults to false. When a session ticket is used, other code already sets a SessionID [again] as required.It would be simpler to skip the new field and remove the default SessionID for TLS 1.2. I'm not sure that produces correct results in all cases though?
The text was updated successfully, but these errors were encountered: