bogdanfinn / tls-client

net/http.Client like HTTP Client with options to select specific client TLS Fingerprints to use for requests.
BSD 4-Clause "Original" or "Old" License
667 stars 133 forks source link

[Feature Request]: Add 0x0301, 0x0303 and other sign algoritms to shared lib. #88

Closed fakeastap closed 6 months ago

fakeastap commented 6 months ago

Describe the feature / enhancement and how it would improve things

Hello. I am using your library from Python. I am trying to make a copy of Client Hello package from one mobile application. On the iOS version of the app, I have successfully captured the parameters I need and it works as I need it to. But trying to do the same with the Android version, I am facing a problem where it is not possible to pass the required supported_signature_algorithms parameters.

Could you please update the table of existing TLS supported_signature_algorithms or allow me to pass them in raw form as a hexadecimal number?

image

image image

I hope for your responsiveness. And thank you for your work.

Describe how your proposal will work, with code and/or pseudo-code

        supported_signature_algorithms=[
            "PKCS1WithSHA512",
            "ECDSAWithP521AndSHA512",
            "PKCS1WithSHA384",
            "ECDSAWithP384AndSHA384",
            "PKCS1WithSHA256",
            "ECDSAWithP256AndSHA256",
            0x0301,  # TODO unknown
            0x0303,  # TODO unknown
            "PKCS1WithSHA1",
            "ECDSAWithSHA1",
        ]
bogdanfinn commented 6 months ago

@fakeastap can you try adding the following two strings to your array:

"769" instead of 0x0301
"771" instead of 0x0303

see:

I implemented back then a possibility to supply the usigned integer value as string if its not part of the mapping table. This should do the trick for you.

But sure i will add the two values in one of the next releases.

bogdanfinn commented 6 months ago

https://www.simonv.fr/TypesConvert/?integers

Bildschirmfoto 2023-12-14 um 21 34 02 Bildschirmfoto 2023-12-14 um 21 33 51
fakeastap commented 6 months ago

oh thanks!! it works

upd: but it is better to write the values in hex

image
bogdanfinn commented 6 months ago

@fakeastap what do you mean with "it is better to write the values in hex" ?

fakeastap commented 6 months ago

@fakeastap what do you mean with "it is better to write the values in hex" ?

I meant that parameters passed as a string do not need to be converted from hexadecimal to decimal. This works fine: "301" instead of 0x0301 "303" instead of 0x0303.

Just a quick fix, for users who run into a similar problem.

Sorry for my English. I'm just using a translator.

bogdanfinn commented 6 months ago

@fakeastap added those values in latest release v.1.7.0/1.7.1