[tor-commits] [meek/utls_2] Recognize utls=HelloGolang as an alias for omitting utls=.

dcf at torproject.org dcf at torproject.org
Thu Jan 31 08:10:00 UTC 2019


commit b63b55fc99fc5ea05db2d574663c531ae0b84784
Author: David Fifield <david at bamsoftware.com>
Date:   Thu Jan 31 01:09:22 2019 -0700

    Recognize utls=HelloGolang as an alias for omitting utls=.
    
    This is for compatibility with obfs4proxy meek_lite.
---
 doc/meek-client.1     |  8 ++++++--
 doc/meek-client.1.txt | 39 +++++++++++++++++++++++----------------
 meek-client/utls.go   |  8 ++++++--
 3 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/doc/meek-client.1 b/doc/meek-client.1
index 639ccb4..4e44056 100644
--- a/doc/meek-client.1
+++ b/doc/meek-client.1
@@ -2,12 +2,12 @@
 .\"     Title: meek-client
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 01/25/2019
+.\"      Date: 01/31/2019
 .\"    Manual: \ \&
 .\"    Source: \ \&
 .\"  Language: English
 .\"
-.TH "MEEK\-CLIENT" "1" "01/25/2019" "\ \&" "\ \&"
+.TH "MEEK\-CLIENT" "1" "01/31/2019" "\ \&" "\ \&"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -196,6 +196,10 @@ HelloIOS_11_1
 .\}
 HelloIOS_Auto
 .RE
+.sp
+As a special case, the value HelloGolang is recognized as an alias for omitting the
+\fButls\fR
+SOCKS arg; i\&.e\&., use native Go TLS\&.
 .RE
 .sp
 For backward compatibility, each SOCKS arg also has an equivalent command line option\&. For example, this configuration using SOCKS args:
diff --git a/doc/meek-client.1.txt b/doc/meek-client.1.txt
index fbeb4d2..fc2303e 100644
--- a/doc/meek-client.1.txt
+++ b/doc/meek-client.1.txt
@@ -44,22 +44,29 @@ The possible SOCKS args are:
     The URL's true domain name will still appear in the Host header
     of HTTP requests.
 **utls**=__CLIENTHELLOID__::
-    Use the https://github.com/refraction-networking/utls[uTLS library]
-    with the named TLS fingerprint for TLS camouflage.
-    This arg is incompatible with the **--helper** command line option.
-    The possible values of __CLIENTHELLOID__ are:
-    - HelloRandomizedALPN
-    - HelloRandomizedNoALPN
-    - HelloFirefox_55
-    - HelloFirefox_56
-    - HelloFirefox_63
-    - HelloFirefox_Auto
-    - HelloChrome_58
-    - HelloChrome_62
-    - HelloChrome_70
-    - HelloChrome_Auto
-    - HelloIOS_11_1
-    - HelloIOS_Auto
++
+--
+Use the https://github.com/refraction-networking/utls[uTLS library]
+with the named TLS fingerprint for TLS camouflage.
+This arg is incompatible with the **--helper** command line option.
+The possible values of __CLIENTHELLOID__ are:
+
+- HelloRandomizedALPN
+- HelloRandomizedNoALPN
+- HelloFirefox_55
+- HelloFirefox_56
+- HelloFirefox_63
+- HelloFirefox_Auto
+- HelloChrome_58
+- HelloChrome_62
+- HelloChrome_70
+- HelloChrome_Auto
+- HelloIOS_11_1
+- HelloIOS_Auto
+
+As a special case, the value HelloGolang is recognized as an alias for
+omitting the **utls** SOCKS arg; i.e., use native Go TLS.
+--
 
 For backward compatibility, each SOCKS arg also has an equivalent
 command line option.
diff --git a/meek-client/utls.go b/meek-client/utls.go
index 2c9c52e..f64b731 100644
--- a/meek-client/utls.go
+++ b/meek-client/utls.go
@@ -208,8 +208,8 @@ func makeRoundTripper(req *http.Request, clientHelloID *utls.ClientHelloID) (htt
 
 var clientHelloIDMap = map[string]*utls.ClientHelloID{
 	// No HelloCustom: not useful for external configuration.
-	// No HelloGolang: just don't use uTLS.
 	// No HelloRandomized: doesn't negotiate consistent ALPN.
+	"hellogolang":           nil, // special case: disable uTLS
 	"hellorandomizedalpn":   &utls.HelloRandomizedALPN,
 	"hellorandomizednoalpn": &utls.HelloRandomizedNoALPN,
 	"hellofirefox_auto":     &utls.HelloFirefox_Auto,
@@ -224,12 +224,16 @@ var clientHelloIDMap = map[string]*utls.ClientHelloID{
 	"helloios_11_1":         &utls.HelloIOS_11_1,
 }
 
-func NewUTLSRoundTripper(name string) (*UTLSRoundTripper, error) {
+func NewUTLSRoundTripper(name string) (http.RoundTripper, error) {
 	// Lookup is case-insensitive.
 	clientHelloID, ok := clientHelloIDMap[strings.ToLower(name)]
 	if !ok {
 		return nil, fmt.Errorf("no uTLS Client Hello ID named %q", name)
 	}
+	if clientHelloID == nil {
+		// Special case for HelloGolang.
+		return httpRoundTripper, nil
+	}
 	return &UTLSRoundTripper{
 		clientHelloID: clientHelloID,
 	}, nil



More information about the tor-commits mailing list