forked from ooni/probe-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This diff enables `websteps` to use uTLS for TLS parroting. It integrates the `oohttp.StdlibTransport` wrapper which uses the `ooni/oohttp` fork. `oohttp` supports TLS-like connections like `utls.Conn`. As a prototype, the testhelper and `websteps` code now uses the `utls.HelloChrome_Auto` fingerprint, i.e. the simulated TLS fingerprint of the Google Chrome browser. It is a further contribution for my GSoC project. Reference issue: ooni/probe#1733
- Loading branch information
1 parent
93613b3
commit b621975
Showing
10 changed files
with
66 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
package websteps | ||
|
||
import ( | ||
"context" | ||
"crypto/tls" | ||
"net" | ||
|
||
"github.com/ooni/probe-cli/v3/internal/netxlite" | ||
utls "gitlab.com/yawning/utls.git" | ||
) | ||
|
||
// TLSDo performs the TLS check. | ||
func TLSDo(conn net.Conn, hostname string) (*tls.Conn, error) { | ||
tlsConn := tls.Client(conn, &tls.Config{ | ||
func TLSDo(ctx context.Context, conn net.Conn, hostname string) (net.Conn, error) { | ||
tlsConf := &tls.Config{ | ||
ServerName: hostname, | ||
NextProtos: []string{"h2", "http/1.1"}, | ||
}) | ||
err := tlsConn.Handshake() | ||
} | ||
h := &netxlite.TLSHandshakerConfigurable{ | ||
NewConn: netxlite.NewConnUTLS(&utls.HelloChrome_Auto), | ||
} | ||
tlsConn, _, err := h.Handshake(ctx, conn, tlsConf) | ||
return tlsConn, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters