From 1de31adf8c04ecf0a27309672347ce625d94a405 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:37:08 +0800 Subject: [PATCH 01/41] Update utils.go --- transport/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/utils.go b/transport/utils.go index c63338c..55a0dc7 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -196,7 +196,7 @@ func genMap() (extMap map[string]utls.TLSExtension) { }, }, "16": &utls.ALPNExtension{ - AlpnProtocols: []string{"h2", "http/1.1"}, + AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}, }, "17": &utls.GenericExtension{Id: 17}, // status_request_v2 "18": &utls.SCTExtension{}, From 1287495ac55892e5ed53b1ee6dd514e31e1b8ba3 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:53:11 +0800 Subject: [PATCH 02/41] Create go-ossf-slsa3-publish.yml --- .github/workflows/go-ossf-slsa3-publish.yml | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/go-ossf-slsa3-publish.yml diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml new file mode 100644 index 0000000..3c1d7d5 --- /dev/null +++ b/.github/workflows/go-ossf-slsa3-publish.yml @@ -0,0 +1,38 @@ +# 此工作流程使用未经 GitHub 认证的操作。 +# 它们由第三方提供并受 +# 单独的服务条款、隐私政策和支持 +# 文档。 + +# 此工作流程允许您使用 SLSA3 兼容的构建器编译 Go 项目。 +# 此工作流程将生成一个所谓的“来源”文件,描述步骤 +# 执行这些操作是为了生成最终的二进制文件。 +# 该项目是 OpenSSF (openssf.org) 的一项倡议,开发于 +# https://github.com/slsa-framework/slsa-github-generator。 +# 来源文件可以使用 https://github.com/slsa-framework/slsa-verifier 进行验证。 +# 有关 SLSA 及其如何改进供应链的更多信息,请访问 slsa.dev。 + +姓名:名称: SLSA Go 发行者 +在: + 工作流程_调度: + 发布: + 类型:[已创建]] + +permissions: 权限:只读 + +jobs: + # =================================================== =================================================== =======================================# ======================================================================================================================================== + # 先决条件:在项目的根目录中创建一个 .slsa-goreleaser.yml。# Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project. + # 请参阅 https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file 中的格式# See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file + #=================================================== =================================================== =======================================#========================================================================================================================================= + build: + permissions: + id-token: id-token:写#来签名。# To sign. + contents: 内容:写入 # 上传发布资产。# To upload release assets. + actions: actions: read # 读取工作流程路径。# To read workflow path. + uses: 使用:slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0 + with: + go-version: 1.17 + # =================================================== =================================================== =========# ============================================================================================================= + # 可选:更多选项请参见 https://github.com/slsa-framework/slsa-github-generator#golang-projects# Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects + # ============================================================================================================= + From 8a71b5ba1830317f2a8d39d25599dfd57e9cc729 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:59:26 +0800 Subject: [PATCH 03/41] Update go.mod --- go.mod | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index b54a7b2..37e56e9 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -module github.com/wangluozhe/requests +模块 github.com/760644586/requests -go 1.20 +去1.20 -require ( +要求 ( github.com/andybalholm/brotli v1.0.6 github.com/bitly/go-simplejson v0.5.0 github.com/google/uuid v1.3.0 @@ -10,14 +10,14 @@ require ( github.com/wangluozhe/chttp v0.0.4 golang.org/x/crypto v0.17.0 golang.org/x/net v0.17.0 -) +) -require ( - github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/cloudflare/circl v1.3.6 // indirect - github.com/klauspost/compress v1.17.4 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/quic-go/quic-go v0.40.1 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/text v0.14.0 // indirect -) +要求 ( + github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // 间接 + github.com/cloudflare/circl v1.3.6 // 间接 + github.com/klauspost/compress v1.17.4 // 间接 + github.com/kr/pretty v0.3.1 // 间接 + github.com/quic-go/quic-go v0.40.1 // 间接 + golang.org/x/sys v0.15.0 // 间接 + golang.org/x/text v0.14.0 // 间接 +) From 9ada7b99e56e400d1e721d66d47b62dcb3b3eb9f Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:59:57 +0800 Subject: [PATCH 04/41] Update go.mod --- go.mod | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 37e56e9..7d63353 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -模块 github.com/760644586/requests +module github.com/760644586/requests -去1.20 +go 1.20 -要求 ( +require ( github.com/andybalholm/brotli v1.0.6 github.com/bitly/go-simplejson v0.5.0 github.com/google/uuid v1.3.0 @@ -10,14 +10,14 @@ github.com/wangluozhe/chttp v0.0.4 golang.org/x/crypto v0.17.0 golang.org/x/net v0.17.0 -) +) -要求 ( - github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // 间接 - github.com/cloudflare/circl v1.3.6 // 间接 - github.com/klauspost/compress v1.17.4 // 间接 - github.com/kr/pretty v0.3.1 // 间接 - github.com/quic-go/quic-go v0.40.1 // 间接 - golang.org/x/sys v0.15.0 // 间接 - golang.org/x/text v0.14.0 // 间接 -) +require ( + github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect + github.com/cloudflare/circl v1.3.6 // indirect + github.com/klauspost/compress v1.17.4 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/quic-go/quic-go v0.40.1 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect +) From 726aa7561bff248ae0648dab8489b789faed304e Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:08:13 +0800 Subject: [PATCH 05/41] Update tlsextensions-test.go --- examples/tlsextensions-test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/tlsextensions-test.go b/examples/tlsextensions-test.go index 3dd9d70..e2cce0f 100644 --- a/examples/tlsextensions-test.go +++ b/examples/tlsextensions-test.go @@ -3,9 +3,9 @@ package main import ( "fmt" http "github.com/wangluozhe/chttp" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/transport" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/transport" + "github.com/760644586/requests/url" ) func main() { From 859311033883ca611b698ebe1409534fc7deaa0c Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:09:17 +0800 Subject: [PATCH 06/41] Update session-test.go --- examples/session-test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/session-test.go b/examples/session-test.go index 78cf0b3..224e03e 100644 --- a/examples/session-test.go +++ b/examples/session-test.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" + "github.com/760644586/requests" ) func main() { From 4a448a728dcad4cc3aa402386613efd4f076c144 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:09:32 +0800 Subject: [PATCH 07/41] Update postForm-test.go --- examples/postForm-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/postForm-test.go b/examples/postForm-test.go index cddd79f..ff898a8 100644 --- a/examples/postForm-test.go +++ b/examples/postForm-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From be8dbb2711ce0fa5777706c448550e075283de27 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:09:47 +0800 Subject: [PATCH 08/41] Update params-test.go --- examples/params-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/params-test.go b/examples/params-test.go index aa5dc10..98406bf 100644 --- a/examples/params-test.go +++ b/examples/params-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From 8e2fdc47b18a0ce7c15650edd1dd37b51bfd4c7f Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:10:05 +0800 Subject: [PATCH 09/41] Update orderHeader-test.go --- examples/orderHeader-test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/orderHeader-test.go b/examples/orderHeader-test.go index f3715d9..1114a23 100644 --- a/examples/orderHeader-test.go +++ b/examples/orderHeader-test.go @@ -2,9 +2,9 @@ package main import ( "fmt" - http "github.com/wangluozhe/chttp" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + http "github.com/760644586/chttp" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From f2d0dd13f671f94df977ec2349a53c69c7761353 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:10:19 +0800 Subject: [PATCH 10/41] Update json-test.go --- examples/json-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/json-test.go b/examples/json-test.go index 82ade4d..58ca2c2 100644 --- a/examples/json-test.go +++ b/examples/json-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From 55acade4723c1acddd586ce871b23d2d69d4a65c Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:10:37 +0800 Subject: [PATCH 11/41] Update ja4-test.go --- examples/ja4-test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/ja4-test.go b/examples/ja4-test.go index 75346f9..54cb5a6 100644 --- a/examples/ja4-test.go +++ b/examples/ja4-test.go @@ -2,10 +2,10 @@ package main import ( "fmt" - http "github.com/wangluozhe/chttp" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/transport" - "github.com/wangluozhe/requests/url" + http "github.com/760644586/chttp" + "github.com/760644586/requests" + "github.com/760644586/requests/transport" + "github.com/760644586/requests/url" ) func main() { From e78833f95b795eab305f14a331604066660c045c Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:10:52 +0800 Subject: [PATCH 12/41] Update ja3-test.go --- examples/ja3-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ja3-test.go b/examples/ja3-test.go index d72d8e3..3d33ea9 100644 --- a/examples/ja3-test.go +++ b/examples/ja3-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From ead106133b05bc03a4201ad7283e85529fd279d7 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:11:14 +0800 Subject: [PATCH 13/41] Update http2settings-test.go --- examples/http2settings-test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/http2settings-test.go b/examples/http2settings-test.go index 135a032..f64c9c9 100644 --- a/examples/http2settings-test.go +++ b/examples/http2settings-test.go @@ -2,10 +2,10 @@ package main import ( "fmt" - http "github.com/wangluozhe/chttp" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/transport" - "github.com/wangluozhe/requests/url" + http "github.com/760644586/chttp" + "github.com/760644586/requests" + "github.com/760644586/requests/transport" + "github.com/760644586/requests/url" ) func main() { From 331770351315a64dab4533fbe2a2faf1066c4105 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:11:30 +0800 Subject: [PATCH 14/41] Update get-test.go --- examples/get-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-test.go b/examples/get-test.go index a29d0d2..754bc70 100644 --- a/examples/get-test.go +++ b/examples/get-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From 007830c7ce967695f2947445d4e7a35d168e4d1e Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:11:43 +0800 Subject: [PATCH 15/41] Update encode-test.go --- examples/encode-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/encode-test.go b/examples/encode-test.go index 4a074eb..67c77cf 100644 --- a/examples/encode-test.go +++ b/examples/encode-test.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/utils" ) func main() { @@ -37,4 +37,4 @@ func main() { fmt.Println(escape) unescape := utils.UnEscape(escape) fmt.Println(unescape) -} \ No newline at end of file +} From 11b18712911b149e2c259f6fc5b8a1c8068e7854 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:12:05 +0800 Subject: [PATCH 16/41] Update data-test.go --- examples/data-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/data-test.go b/examples/data-test.go index e3bd920..4270766 100644 --- a/examples/data-test.go +++ b/examples/data-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From 49f6232a0299dd72e737d5d10f2a92319e57f40d Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:12:23 +0800 Subject: [PATCH 17/41] Update custom_settings.go --- examples/custom_settings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/custom_settings.go b/examples/custom_settings.go index 654098f..ed09399 100644 --- a/examples/custom_settings.go +++ b/examples/custom_settings.go @@ -3,7 +3,7 @@ package main import ( "fmt" http "github.com/wangluozhe/chttp" - "github.com/wangluozhe/requests/transport" + "github.com/760644586/requests/transport" "io" "log" "strings" From bc2e64b8f223e7ae928d40a40e83273df5d3c626 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:12:42 +0800 Subject: [PATCH 18/41] Update crypto-sha-test.go --- examples/crypto-sha-test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/crypto-sha-test.go b/examples/crypto-sha-test.go index 14fad08..34af65f 100644 --- a/examples/crypto-sha-test.go +++ b/examples/crypto-sha-test.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/utils" ) func main() { From 15f04d3454eb237d4b9df2ae94723ac4c0122591 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:12:52 +0800 Subject: [PATCH 19/41] Update crypto-rc4-test.go --- examples/crypto-rc4-test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/crypto-rc4-test.go b/examples/crypto-rc4-test.go index c0c39fe..5f731c6 100644 --- a/examples/crypto-rc4-test.go +++ b/examples/crypto-rc4-test.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/utils" ) func main() { From 521a0822686cb06478e21b9af194f4a04b9360b6 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:13:03 +0800 Subject: [PATCH 20/41] Update crypto-md5-test.go --- examples/crypto-md5-test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/crypto-md5-test.go b/examples/crypto-md5-test.go index b90cabf..778349d 100644 --- a/examples/crypto-md5-test.go +++ b/examples/crypto-md5-test.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/utils" ) func main() { From 97f406b800ce9a4975b678c3bccd1cfe9b172f67 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:13:12 +0800 Subject: [PATCH 21/41] Update crypto-hmac.go --- examples/crypto-hmac.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/crypto-hmac.go b/examples/crypto-hmac.go index d1bcb76..a7c7b47 100644 --- a/examples/crypto-hmac.go +++ b/examples/crypto-hmac.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/utils" ) func main() { From 0c8fb1226aec1e0f772b9c2e7bf89fadd62a300f Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:13:24 +0800 Subject: [PATCH 22/41] Update cookies-test.go --- examples/cookies-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cookies-test.go b/examples/cookies-test.go index a23f392..24755a2 100644 --- a/examples/cookies-test.go +++ b/examples/cookies-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From 15a4b35930a7e38211b41a5d4e834956248ae52f Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:13:36 +0800 Subject: [PATCH 23/41] Update body-test.go --- examples/body-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/body-test.go b/examples/body-test.go index 606a861..c0c3295 100644 --- a/examples/body-test.go +++ b/examples/body-test.go @@ -2,8 +2,8 @@ package main import ( "fmt" - "github.com/wangluozhe/requests" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests" + "github.com/760644586/requests/url" ) func main() { From 8ffcfa034c034415550eb01d5c97238e78c7010a Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:14:24 +0800 Subject: [PATCH 24/41] Update api.go --- api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.go b/api.go index 1b5dd6e..cefe33c 100644 --- a/api.go +++ b/api.go @@ -1,8 +1,8 @@ package requests import ( - "github.com/wangluozhe/requests/models" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests/models" + "github.com/760644586/requests/url" "net/http" ) @@ -46,4 +46,4 @@ func Connect(rawurl string, req *url.Request) (*models.Response, error) { func Trace(rawurl string, req *url.Request) (*models.Response, error) { return Request(http.MethodTrace, rawurl, req) -} \ No newline at end of file +} From b9d32b0083a3a3ce383c36d37d4b1255e7d593f4 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:14:55 +0800 Subject: [PATCH 25/41] Update sessions.go --- sessions.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sessions.go b/sessions.go index 043d8d4..9568991 100644 --- a/sessions.go +++ b/sessions.go @@ -13,10 +13,10 @@ import ( "github.com/wangluozhe/chttp" "github.com/wangluozhe/chttp/cookiejar" "github.com/wangluozhe/chttp/http2" - "github.com/wangluozhe/requests/models" - ja3 "github.com/wangluozhe/requests/transport" - "github.com/wangluozhe/requests/url" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/models" + ja3 "github.com/760644586/requests/transport" + "github.com/760644586/requests/url" + "github.com/760644586/requests/utils" "io/ioutil" "log" url2 "net/url" From 3c0c3069647579cbfac660e6b5f35192df3b340c Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:15:12 +0800 Subject: [PATCH 26/41] Update version.go --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index 3deb575..c2e9aea 100644 --- a/version.go +++ b/version.go @@ -2,6 +2,6 @@ package requests const ( NAME = "golang-requests" // 名称 - VERSION = "1.2.4" // 当前版本 + VERSION = "1.2.5" // 当前版本 USER_AGENT = NAME + VERSION // UA ) From d72cb720e3d478422acf753c4c6a3d4e9de6809c Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:15:49 +0800 Subject: [PATCH 27/41] Update Request.go --- url/Request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url/Request.go b/url/Request.go index 419c703..d59cf20 100644 --- a/url/Request.go +++ b/url/Request.go @@ -4,7 +4,7 @@ import ( "github.com/wangluozhe/chttp" "github.com/wangluozhe/chttp/cookiejar" "github.com/wangluozhe/chttp/http2" - ja3 "github.com/wangluozhe/requests/transport" + ja3 "github.com/wangluozhe/760644586/transport" "time" ) From 530ca72391e7c2868c825003d725b531ed936cdc Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:16:05 +0800 Subject: [PATCH 28/41] Update Values.go --- url/Values.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url/Values.go b/url/Values.go index 6b44ec7..2aab1a1 100644 --- a/url/Values.go +++ b/url/Values.go @@ -1,7 +1,7 @@ package url import ( - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/utils" "strconv" "strings" "sync" From a4d09200e67a275dfae10a22325231dcf9e24136 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:16:48 +0800 Subject: [PATCH 29/41] Update PrepareRequest.go --- models/PrepareRequest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/PrepareRequest.go b/models/PrepareRequest.go index 2f237a4..b557ba1 100644 --- a/models/PrepareRequest.go +++ b/models/PrepareRequest.go @@ -7,8 +7,8 @@ import ( "fmt" "github.com/wangluozhe/chttp" "github.com/wangluozhe/chttp/cookiejar" - "github.com/wangluozhe/requests/url" - "github.com/wangluozhe/requests/utils" + "github.com/760644586/requests/url" + "github.com/760644586/requests/utils" "io" "io/ioutil" "strconv" From 5f2e0352fb0e9a95547c123b8e2e964514ec5a27 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:16:59 +0800 Subject: [PATCH 30/41] Update Request.go --- models/Request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/Request.go b/models/Request.go index bbc274d..a3ce24c 100644 --- a/models/Request.go +++ b/models/Request.go @@ -3,7 +3,7 @@ package models import ( "github.com/wangluozhe/chttp" "github.com/wangluozhe/chttp/cookiejar" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests/url" ) type Request struct { From 26246c3cecb51a725b88111d1a751c5a094e1423 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:17:12 +0800 Subject: [PATCH 31/41] Update Response.go --- models/Response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/Response.go b/models/Response.go index 874953e..716ae73 100644 --- a/models/Response.go +++ b/models/Response.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/bitly/go-simplejson" "github.com/wangluozhe/chttp" - "github.com/wangluozhe/requests/url" + "github.com/760644586/requests/url" "io" ) From 7db4b0ec46e8361d2f1cbeb4fad773427caaf8e1 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:25:03 +0800 Subject: [PATCH 32/41] Update Request.go --- url/Request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url/Request.go b/url/Request.go index d59cf20..9717971 100644 --- a/url/Request.go +++ b/url/Request.go @@ -4,7 +4,7 @@ import ( "github.com/wangluozhe/chttp" "github.com/wangluozhe/chttp/cookiejar" "github.com/wangluozhe/chttp/http2" - ja3 "github.com/wangluozhe/760644586/transport" + ja3 "github.com/760644586/requests/transport" "time" ) From dcb415b694d0a5e96856a0cf25ff9989d57888f9 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:34:30 +0800 Subject: [PATCH 33/41] Update utils.go --- transport/utils.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index 55a0dc7..842416c 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -177,22 +177,12 @@ func genMap() (extMap map[string]utls.TLSExtension) { extMap = map[string]utls.TLSExtension{ "0": &utls.SNIExtension{}, "5": &utls.StatusRequestExtension{}, - // These are applied later - // "10": &tls.SupportedCurvesExtension{...} - // "11": &tls.SupportedPointsExtension{...} "13": &utls.SignatureAlgorithmsExtension{ SupportedSignatureAlgorithms: []utls.SignatureScheme{ utls.ECDSAWithP256AndSHA256, utls.ECDSAWithP384AndSHA384, utls.ECDSAWithP521AndSHA512, utls.PSSWithSHA256, - utls.PSSWithSHA384, - utls.PSSWithSHA512, - utls.PKCS1WithSHA256, - utls.PKCS1WithSHA384, - utls.PKCS1WithSHA512, - utls.ECDSAWithSHA1, - utls.PKCS1WithSHA1, }, }, "16": &utls.ALPNExtension{ @@ -222,7 +212,6 @@ func genMap() (extMap map[string]utls.TLSExtension) { "41": &utls.UtlsPreSharedKeyExtension{}, //FIXME pre_shared_key "43": &utls.SupportedVersionsExtension{Versions: []uint16{ utls.VersionTLS13, - utls.VersionTLS12, }}, "44": &utls.CookieExtension{}, "45": &utls.PSKKeyExchangeModesExtension{Modes: []uint8{ @@ -235,19 +224,10 @@ func genMap() (extMap map[string]utls.TLSExtension) { utls.ECDSAWithP384AndSHA384, utls.ECDSAWithP521AndSHA512, utls.PSSWithSHA256, - utls.PSSWithSHA384, - utls.PSSWithSHA512, - utls.PKCS1WithSHA256, - utls.PKCS1WithSHA384, - utls.PKCS1WithSHA512, - utls.ECDSAWithSHA1, - utls.PKCS1WithSHA1, }, }, // signature_algorithms_cert "51": &utls.KeyShareExtension{KeyShares: []utls.KeyShare{ {Group: utls.X25519}, - - // {Group: utls.CurveP384}, known bug missing correct extensions for handshake }}, "57": &utls.QUICTransportParametersExtension{}, "13172": &utls.NPNExtension{}, From 89b3a681a705dd686a55617cd353c16b4f6a1b97 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:17:58 +0800 Subject: [PATCH 34/41] Update utils.go --- transport/utils.go | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index 842416c..1760259 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -48,25 +48,7 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo } // parse curves var targetCurves []utls.CurveID - if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - targetCurves = append(targetCurves, utls.CurveID(utls.GREASE_PLACEHOLDER)) //append grease for Chrome browsers - if supportedVersionsExt, ok := extMap["43"]; ok { - if supportedVersions, ok := supportedVersionsExt.(*utls.SupportedVersionsExtension); ok { - supportedVersions.Versions = append([]uint16{utls.GREASE_PLACEHOLDER}, supportedVersions.Versions...) - } - } - if keyShareExt, ok := extMap["51"]; ok { - if keyShare, ok := keyShareExt.(*utls.KeyShareExtension); ok { - keyShare.KeyShares = append([]utls.KeyShare{{Group: utls.CurveID(utls.GREASE_PLACEHOLDER), Data: []byte{0}}}, keyShare.KeyShares...) - } - } - } else { - if keyShareExt, ok := extMap["51"]; ok { - if keyShare, ok := keyShareExt.(*utls.KeyShareExtension); ok { - keyShare.KeyShares = append(keyShare.KeyShares, utls.KeyShare{Group: utls.CurveP256}) - } - } - } + for _, c := range curves { cid, err := strconv.ParseUint(c, 10, 16) if err != nil { @@ -151,10 +133,7 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo // build CipherSuites var suites []uint16 - //Optionally Add Chrome Grease Extension - if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - suites = append(suites, utls.GREASE_PLACEHOLDER) - } + for _, c := range ciphers { cid, err := strconv.ParseUint(c, 10, 16) if err != nil { @@ -164,8 +143,6 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo } _ = vid return &utls.ClientHelloSpec{ - // TLSVersMin: vid, - // TLSVersMax: vid, CipherSuites: suites, CompressionMethods: []byte{0}, Extensions: exts, @@ -185,9 +162,7 @@ func genMap() (extMap map[string]utls.TLSExtension) { utls.PSSWithSHA256, }, }, - "16": &utls.ALPNExtension{ - AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}, - }, + "16": &utls.ALPNExtension{AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}}, "17": &utls.GenericExtension{Id: 17}, // status_request_v2 "18": &utls.SCTExtension{}, "21": &utls.UtlsPaddingExtension{GetPaddingLen: utls.BoringPaddingStyle}, From b512d6cd558be8b4844194a62fed162d1037af5c Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:29:32 +0800 Subject: [PATCH 35/41] Update utils.go --- transport/utils.go | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index 1760259..a5a0313 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -48,7 +48,19 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo } // parse curves var targetCurves []utls.CurveID - + if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + targetCurves = append(targetCurves, utls.CurveID(utls.GREASE_PLACEHOLDER)) //append grease for Chrome browsers + if supportedVersionsExt, ok := extMap["43"]; ok { + if supportedVersions, ok := supportedVersionsExt.(*utls.SupportedVersionsExtension); ok { + supportedVersions.Versions = append([]uint16{utls.GREASE_PLACEHOLDER}, supportedVersions.Versions...) + } + } + if keyShareExt, ok := extMap["51"]; ok { + if keyShare, ok := keyShareExt.(*utls.KeyShareExtension); ok { + keyShare.KeyShares = append([]utls.KeyShare{{Group: utls.CurveID(utls.GREASE_PLACEHOLDER), Data: []byte{0}}}, keyShare.KeyShares...) + } + } + } for _, c := range curves { cid, err := strconv.ParseUint(c, 10, 16) if err != nil { @@ -133,7 +145,10 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo // build CipherSuites var suites []uint16 - + //Optionally Add Chrome Grease Extension + if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + suites = append(suites, utls.GREASE_PLACEHOLDER) + } for _, c := range ciphers { cid, err := strconv.ParseUint(c, 10, 16) if err != nil { @@ -154,6 +169,9 @@ func genMap() (extMap map[string]utls.TLSExtension) { extMap = map[string]utls.TLSExtension{ "0": &utls.SNIExtension{}, "5": &utls.StatusRequestExtension{}, + // These are applied later + // "10": &tls.SupportedCurvesExtension{...} + // "11": &tls.SupportedPointsExtension{...} "13": &utls.SignatureAlgorithmsExtension{ SupportedSignatureAlgorithms: []utls.SignatureScheme{ utls.ECDSAWithP256AndSHA256, @@ -162,7 +180,9 @@ func genMap() (extMap map[string]utls.TLSExtension) { utls.PSSWithSHA256, }, }, - "16": &utls.ALPNExtension{AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}}, + "16": &utls.ALPNExtension{ + AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}, + }, "17": &utls.GenericExtension{Id: 17}, // status_request_v2 "18": &utls.SCTExtension{}, "21": &utls.UtlsPaddingExtension{GetPaddingLen: utls.BoringPaddingStyle}, From c0eca2c7e1cf22cbb1344a64f334146a9f73d309 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:41:12 +0800 Subject: [PATCH 36/41] Update utils.go --- transport/utils.go | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index a5a0313..739cdb3 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -48,26 +48,7 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo } // parse curves var targetCurves []utls.CurveID - if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - targetCurves = append(targetCurves, utls.CurveID(utls.GREASE_PLACEHOLDER)) //append grease for Chrome browsers - if supportedVersionsExt, ok := extMap["43"]; ok { - if supportedVersions, ok := supportedVersionsExt.(*utls.SupportedVersionsExtension); ok { - supportedVersions.Versions = append([]uint16{utls.GREASE_PLACEHOLDER}, supportedVersions.Versions...) - } - } - if keyShareExt, ok := extMap["51"]; ok { - if keyShare, ok := keyShareExt.(*utls.KeyShareExtension); ok { - keyShare.KeyShares = append([]utls.KeyShare{{Group: utls.CurveID(utls.GREASE_PLACEHOLDER), Data: []byte{0}}}, keyShare.KeyShares...) - } - } - } - for _, c := range curves { - cid, err := strconv.ParseUint(c, 10, 16) - if err != nil { - return nil, err - } - targetCurves = append(targetCurves, utls.CurveID(cid)) - } + extMap["10"] = &utls.SupportedCurvesExtension{Curves: targetCurves} // parse point formats From 7ae91f0f12becacb16f5e0b703c7bc547d816ab7 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:45:16 +0800 Subject: [PATCH 37/41] Update utils.go --- transport/utils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/transport/utils.go b/transport/utils.go index 739cdb3..4aa7c20 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -49,6 +49,16 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo // parse curves var targetCurves []utls.CurveID + + for _, c := range curves { + cid, err := strconv.ParseUint(c, 10, 16) + if err != nil { + return nil, err + } + targetCurves = append(targetCurves, utls.CurveID(cid)) + } + + extMap["10"] = &utls.SupportedCurvesExtension{Curves: targetCurves} // parse point formats From 9ea005046a2841305ad3f111cdf5db3828c6dad4 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:13:56 +0800 Subject: [PATCH 38/41] Update utils.go --- transport/utils.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index 4aa7c20..4ab050d 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -119,27 +119,27 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo // build extenions list var exts []utls.TLSExtension //Optionally Add Chrome Grease Extension - if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - exts = append(exts, &utls.UtlsGREASEExtension{}) - } + //if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + //exts = append(exts, &utls.UtlsGREASEExtension{}) + //} for _, e := range extensions { te, ok := extMap[e] if !ok { return nil, raiseExtensionError(e) } // //Optionally add Chrome Grease Extension - if e == "21" && parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - exts = append(exts, &utls.UtlsGREASEExtension{}) - } + //if e == "21" && parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + // exts = append(exts, &utls.UtlsGREASEExtension{}) + //} exts = append(exts, te) } // build CipherSuites var suites []uint16 //Optionally Add Chrome Grease Extension - if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - suites = append(suites, utls.GREASE_PLACEHOLDER) - } + //if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + //suites = append(suites, utls.GREASE_PLACEHOLDER) + //} for _, c := range ciphers { cid, err := strconv.ParseUint(c, 10, 16) if err != nil { From 88080204e8948e6268667769db04ba6a2061b53e Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:18:38 +0800 Subject: [PATCH 39/41] Update utils.go --- transport/utils.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index 4ab050d..2881078 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -119,27 +119,27 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo // build extenions list var exts []utls.TLSExtension //Optionally Add Chrome Grease Extension - //if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - //exts = append(exts, &utls.UtlsGREASEExtension{}) - //} + if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + exts = append(exts, &utls.UtlsGREASEExtension{}) + } for _, e := range extensions { te, ok := extMap[e] if !ok { return nil, raiseExtensionError(e) } - // //Optionally add Chrome Grease Extension - //if e == "21" && parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - // exts = append(exts, &utls.UtlsGREASEExtension{}) - //} + //Optionally add Chrome Grease Extension + if e == "21" && parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + exts = append(exts, &utls.UtlsGREASEExtension{}) + } exts = append(exts, te) } // build CipherSuites var suites []uint16 //Optionally Add Chrome Grease Extension - //if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - //suites = append(suites, utls.GREASE_PLACEHOLDER) - //} + if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { + suites = append(suites, utls.GREASE_PLACEHOLDER) + } for _, c := range ciphers { cid, err := strconv.ParseUint(c, 10, 16) if err != nil { From da8ce1453abb6f99d56d61acbe04355da4c3f9e6 Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:25:02 +0800 Subject: [PATCH 40/41] Update utils.go --- transport/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/utils.go b/transport/utils.go index 2881078..4aa7c20 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -127,7 +127,7 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo if !ok { return nil, raiseExtensionError(e) } - //Optionally add Chrome Grease Extension + // //Optionally add Chrome Grease Extension if e == "21" && parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { exts = append(exts, &utls.UtlsGREASEExtension{}) } From 14d4a970d2c5cfdc01e983bde0c92d656af7e5df Mon Sep 17 00:00:00 2001 From: 760644586 <41118619+760644586@users.noreply.github.com> Date: Wed, 17 Jan 2024 20:02:58 +0800 Subject: [PATCH 41/41] Update utils.go --- transport/utils.go | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/transport/utils.go b/transport/utils.go index 4aa7c20..cfbd24d 100644 --- a/transport/utils.go +++ b/transport/utils.go @@ -48,17 +48,13 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo } // parse curves var targetCurves []utls.CurveID - - for _, c := range curves { - cid, err := strconv.ParseUint(c, 10, 16) + cid, err := strconv.ParseUint(c, 10, 0) if err != nil { return nil, err } targetCurves = append(targetCurves, utls.CurveID(cid)) } - - extMap["10"] = &utls.SupportedCurvesExtension{Curves: targetCurves} // parse point formats @@ -118,19 +114,11 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo // build extenions list var exts []utls.TLSExtension - //Optionally Add Chrome Grease Extension - if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - exts = append(exts, &utls.UtlsGREASEExtension{}) - } for _, e := range extensions { te, ok := extMap[e] if !ok { return nil, raiseExtensionError(e) } - // //Optionally add Chrome Grease Extension - if e == "21" && parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - exts = append(exts, &utls.UtlsGREASEExtension{}) - } exts = append(exts, te) } @@ -138,7 +126,7 @@ func StringToSpec(ja3 string, userAgent string, tlsExtensions *TLSExtensions, fo var suites []uint16 //Optionally Add Chrome Grease Extension if parsedUserAgent == chrome && !tlsExtensions.NotUsedGREASE { - suites = append(suites, utls.GREASE_PLACEHOLDER) + suites = append(suites) } for _, c := range ciphers { cid, err := strconv.ParseUint(c, 10, 16) @@ -160,9 +148,6 @@ func genMap() (extMap map[string]utls.TLSExtension) { extMap = map[string]utls.TLSExtension{ "0": &utls.SNIExtension{}, "5": &utls.StatusRequestExtension{}, - // These are applied later - // "10": &tls.SupportedCurvesExtension{...} - // "11": &tls.SupportedPointsExtension{...} "13": &utls.SignatureAlgorithmsExtension{ SupportedSignatureAlgorithms: []utls.SignatureScheme{ utls.ECDSAWithP256AndSHA256, @@ -171,9 +156,7 @@ func genMap() (extMap map[string]utls.TLSExtension) { utls.PSSWithSHA256, }, }, - "16": &utls.ALPNExtension{ - AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}, - }, + "16": &utls.ALPNExtension{AlpnProtocols: []string{"h2", "h2-fb", "http/1.1"}}, "17": &utls.GenericExtension{Id: 17}, // status_request_v2 "18": &utls.SCTExtension{}, "21": &utls.UtlsPaddingExtension{GetPaddingLen: utls.BoringPaddingStyle},