Skip to content

Commit

Permalink
new ClientHellos and Extensions (#116)
Browse files Browse the repository at this point in the history
* Implement certificate compression

Certificate compression is defined in RFC 8879:
https://datatracker.ietf.org/doc/html/rfc8879

This implementation is client-side only, for server certificates.

* Fix missing LOC

* Add more fingerprints

* Implement ALPS extension

* Merge commit https://github.com/Noooste/utls/blob/fcaacdbbe7adfd23f754372a99cb162eb70e8d5f

- At this commit, github.com/Noooste/utls remained at the original upstream LICENSE

* added HelloChrome102 and HelloFirefox102

* Randomly include ALPS in HelloRandomized

Co-authored-by: Harry Harpham <harry@getlantern.org>
Co-authored-by: Sleeyax <yourd3veloper@gmail.com>
Co-authored-by: Rod Hynes <rod-hynes@users.noreply.github.com>
  • Loading branch information
4 people committed Sep 7, 2022
1 parent 4d3785b commit f781b69
Show file tree
Hide file tree
Showing 5 changed files with 910 additions and 40 deletions.
2 changes: 2 additions & 0 deletions common.go
Expand Up @@ -85,6 +85,7 @@ const (
extensionSignatureAlgorithms uint16 = 13
extensionALPN uint16 = 16
extensionSCT uint16 = 18
extensionDelegatedCredentials uint16 = 34
extensionSessionTicket uint16 = 35
extensionPreSharedKey uint16 = 41
extensionEarlyData uint16 = 42
Expand All @@ -95,6 +96,7 @@ const (
extensionSignatureAlgorithmsCert uint16 = 50
extensionKeyShare uint16 = 51
extensionNextProtoNeg uint16 = 13172 // not IANA assigned
extensionALPS uint16 = 17513
extensionRenegotiationInfo uint16 = 0xff01
)

Expand Down
16 changes: 13 additions & 3 deletions u_common.go
Expand Up @@ -146,22 +146,32 @@ var (
HelloRandomizedNoALPN = ClientHelloID{helloRandomizedNoALPN, helloAutoVers, nil}

// The rest will will parrot given browser.
HelloFirefox_Auto = HelloFirefox_65
HelloFirefox_Auto = HelloFirefox_102
HelloFirefox_55 = ClientHelloID{helloFirefox, "55", nil}
HelloFirefox_56 = ClientHelloID{helloFirefox, "56", nil}
HelloFirefox_63 = ClientHelloID{helloFirefox, "63", nil}
HelloFirefox_65 = ClientHelloID{helloFirefox, "65", nil}
HelloFirefox_99 = ClientHelloID{helloFirefox, "99", nil}
HelloFirefox_102 = ClientHelloID{helloFirefox, "102", nil}

HelloChrome_Auto = HelloChrome_83
HelloChrome_Auto = HelloChrome_102
HelloChrome_58 = ClientHelloID{helloChrome, "58", nil}
HelloChrome_62 = ClientHelloID{helloChrome, "62", nil}
HelloChrome_70 = ClientHelloID{helloChrome, "70", nil}
HelloChrome_72 = ClientHelloID{helloChrome, "72", nil}
HelloChrome_83 = ClientHelloID{helloChrome, "83", nil}
HelloChrome_87 = ClientHelloID{helloChrome, "87", nil}
HelloChrome_96 = ClientHelloID{helloChrome, "96", nil}
HelloChrome_100 = ClientHelloID{helloChrome, "100", nil}
HelloChrome_102 = ClientHelloID{helloChrome, "102", nil}

HelloIOS_Auto = HelloIOS_12_1
HelloIOS_Auto = HelloIOS_14
HelloIOS_11_1 = ClientHelloID{helloIOS, "111", nil} // legacy "111" means 11.1
HelloIOS_12_1 = ClientHelloID{helloIOS, "12.1", nil}
HelloIOS_13 = ClientHelloID{helloIOS, "13", nil}
HelloIOS_14 = ClientHelloID{helloIOS, "14", nil}

HelloAndroid_11_OkHttp = ClientHelloID{helloAndroid, "11", nil}
)

// based on spec's GreaseStyle, GREASE_PLACEHOLDER may be replaced by another GREASE value
Expand Down

0 comments on commit f781b69

Please sign in to comment.