Просмотр исходного кода

Fix nil TLS cached in SendFeedback

Amir Khan 8 месяцев назад
Родитель
Сommit
d9664508a7
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      psiphon/feedback.go

+ 4 - 1
psiphon/feedback.go

@@ -43,6 +43,7 @@ import (
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/errors"
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/errors"
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/parameters"
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/parameters"
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/prng"
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/prng"
+	utls "github.com/Psiphon-Labs/utls"
 )
 )
 
 
 // Conforms to the format expected by the feedback decryptor.
 // Conforms to the format expected by the feedback decryptor.
@@ -181,6 +182,8 @@ func SendFeedback(ctx context.Context, config *Config, diagnostics, uploadPath s
 
 
 	uploadId := prng.HexString(8)
 	uploadId := prng.HexString(8)
 
 
+	tlsCache := utls.NewLRUClientSessionCache(0)
+
 	for i := 0; i < feedbackUploadMaxAttempts; i++ {
 	for i := 0; i < feedbackUploadMaxAttempts; i++ {
 
 
 		uploadURL := transferURLs.Select(i)
 		uploadURL := transferURLs.Select(i)
@@ -231,7 +234,7 @@ func SendFeedback(ctx context.Context, config *Config, diagnostics, uploadPath s
 			feedbackUploadCtx,
 			feedbackUploadCtx,
 			config,
 			config,
 			dialConfig,
 			dialConfig,
-			nil,
+			tlsCache,
 			uploadURL.SkipVerify,
 			uploadURL.SkipVerify,
 			config.DisableSystemRootCAs,
 			config.DisableSystemRootCAs,
 			payloadSecure,
 			payloadSecure,