[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [meek/master] Use a non-empty ServerName in TestProxyHTTPSCONNECT.



commit d9d57c24616a52f3f591fd49e4a5b34e2567fef3
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Fri Sep 3 15:27:01 2021 -0600

    Use a non-empty ServerName in TestProxyHTTPSCONNECT.
    
    The crypto/tls server, since go1.12, requires that if a server_name
    extension is present, it is not empty. With go1.12 and later, this test
    was failing with
            proxy_test.go:95: local error: tls: unexpected message
    
    The specific commit that added the empty server_name check was:
    https://go-review.googlesource.com/c/go/+/144115
    https://github.com/golang/go/commit/4c8b09e9183390d6ab80d3f53a9fe5f6ace92f06#diff-f2f5faeac5da94dc7735456f798177b53421f827b8bfc242b56f116b8e5c7e62R264
    Note the comment "enforcing a couple more 'must not be empty' on the
    unmarshaling side".
    
    Wireshark also complains in a packet capture:
            [Expert Info (Warning/Protocol): Vector length 0 is smaller than minimum 1]
    
    https://bugs.torproject.org/tpo/anti-censorship/pluggable-transports/meek/40002
---
 meek-client/proxy_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meek-client/proxy_test.go b/meek-client/proxy_test.go
index b44c9a2..88ab387 100644
--- a/meek-client/proxy_test.go
+++ b/meek-client/proxy_test.go
@@ -226,7 +226,7 @@ func requestResultingFromDialHTTPS(t *testing.T, makeProxy func(addr net.Addr) (
 
 func TestProxyHTTPSCONNECT(t *testing.T) {
 	req, err := requestResultingFromDialHTTPS(t, func(addr net.Addr) (*httpProxy, error) {
-		return ProxyHTTPS("tcp", addr.String(), nil, proxy.Direct, &utls.Config{InsecureSkipVerify: true}, &utls.HelloFirefox_Auto)
+		return ProxyHTTPS("tcp", addr.String(), nil, proxy.Direct, &utls.Config{InsecureSkipVerify: true, ServerName: testHost}, &utls.HelloFirefox_Auto)
 	}, "tcp", testAddr)
 	if err != nil {
 		panic(err)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits