DemonMartin / tlsClient

A wrapper for bogdanfinn/tls-client based on ffi-rs for unparalleled performance and usability. Inspired by @dryft/tlsclient.
https://www.npmjs.com/package/tlsclientwrapper
21 stars 2 forks source link

Use custom ja3 string #11

Open remmmmmm opened 1 month ago

remmmmmm commented 1 month ago

Hi, Is there a way to pass a custom ja3 string on requests ?

It could be passed into TlsClientOptions or directly into TlsClientDefaultOptions.

Probabilities commented 2 weeks ago

you can do something like this and use a custom client.

{
   "customTlsClient":{
      "ja3String":"771,2570-4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,2570-0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513-2570-21,2570-29-23-24,0",
      "h2Settings":{
         "HEADER_TABLE_SIZE":65536,
         "MAX_CONCURRENT_STREAMS":1000,
         "INITIAL_WINDOW_SIZE":6291456,
         "MAX_HEADER_LIST_SIZE":262144
      },
      "h2SettingsOrder":[
         "HEADER_TABLE_SIZE",
         "MAX_CONCURRENT_STREAMS",
         "INITIAL_WINDOW_SIZE",
         "MAX_HEADER_LIST_SIZE"
      ],
      "supportedSignatureAlgorithms":[
         "ECDSAWithP256AndSHA256",
         "PSSWithSHA256",
         "PKCS1WithSHA256",
         "ECDSAWithP384AndSHA384",
         "PSSWithSHA384",
         "PKCS1WithSHA384",
         "PSSWithSHA512",
         "PKCS1WithSHA512"
      ],
      "supportedVersions":[
         "GREASE",
         "1.3",
         "1.2"
      ],
      "keyShareCurves":[
         "GREASE",
         "X25519"
      ],
      "certCompressionAlgo":"brotli",
      "alpnProtocols":[
         "h2",
         "http/1.1"
      ],
      "alpsProtocols":[
         "h2"
      ],
      "pseudoHeaderOrder":[
         ":method",
         ":authority",
         ":scheme",
         ":path"
      ],
      "connectionFlow":15663105,
      "priorityFrames":[
         {
            "streamID":1,
            "priorityParam":{
               "streamDep":1,
               "exclusive":true,
               "weight":1
            }
         }
      ],
      "headerPriority":{
         "streamDep":1,
         "exclusive":true,
         "weight":1
      }
   }
}

Add this onto TlsClientOptions to use custom ja3.