// import tls "github.com/refraction-networking/utls"
tcpConn, err := net.Dial("tcp", "tlsfingerprint.io:443")
if err != nil {
fmt.Printf("net.Dial() failed: %+v\n", err)
return
}
config := tls.Config{ServerName: "tlsfingerprint.io"}
// This fingerprint includes feature(s), not fully supported by TLS.
// uTLS client with this fingerprint will only be able to to talk to servers,
// that also do not support those features.
tlsConn := tls.UClient(tcpConn, &tlsConfig, tls.HelloCustom)
clientHelloSpec := tls.ClientHelloSpec {
CipherSuites: []uint16{
0xc044,
0xc052,
0xc045,
0xc053,
0x0045,
0x00be,
0xc07c,
0x0088,
0x00c4,
0xc07d,
0xccaa,
0xcc15,
0x0015,
0x009a,
0x000b,
0x000d,
0x0030,
0x003e,
0x00a4,
0x0036,
0x0068,
0x00a5,
0xc03e,
0xc058,
0xc03f,
0xc059,
0x0042,
0x00bb,
0xc082,
0x0085,
0x00c1,
0xc083,
0x000c,
0x0097,
0x000e,
0x0010,
0x0031,
0x003f,
0x00a0,
0x0037,
0x0069,
0x00a1,
0xc040,
0xc054,
0xc041,
0xc055,
0x0043,
0x00bc,
0xc07e,
0x0086,
0x00c2,
0xc07f,
0x000f,
0x0098,
0x0019,
0x0017,
0x001b,
0x0034,
0x006c,
0x00a6,
0x003a,
},
CompressionMethods: []byte{
0x00, // compressionNone
},
Extensions: []tls.TLSExtension{
&tls.SupportedPointsExtension{SupportedPoints: []byte{
0x00, // pointFormatUncompressed
}},
&tls.SupportedCurvesExtension{[]tls.CurveID{
tls.CurveP256,
tls.CurveP384,
tls.CurveP521,
tls.X25519,
0x0100,
}},
&tls.SignatureAlgorithmsExtension{SupportedSignatureAlgorithms: []tls.SignatureScheme{
0x0101,
tls.PKCS1WithSHA1,
0x0301,
tls.PKCS1WithSHA256,
0x0402,
tls.ECDSAWithP256AndSHA256,
0x0407,
0x0408,
tls.PKCS1WithSHA512,
0x0602,
tls.ECDSAWithP521AndSHA512,
0x0607,
0x0608,
},},
},
}
tlsConn.ApplyPreset(&clientHelloSpec)
n, err = tlsConn.Write([]byte("Hello, World!"))
// or tlsConn.Handshake() for better control