summaryrefslogtreecommitdiff
path: root/xS/main.go
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2019-02-27 02:36:04 +0100
committerPřemysl Janouch <p@janouch.name>2019-02-27 02:36:04 +0100
commita1994865a939c6e8b83fc724b94613dce9e8c27f (patch)
treef7736685de8ec606caeabe13132a19306623a768 /xS/main.go
parentc285f3a266f3c276fd3274647f1f324696eb0d19 (diff)
downloadxK-a1994865a939c6e8b83fc724b94613dce9e8c27f.tar.gz
xK-a1994865a939c6e8b83fc724b94613dce9e8c27f.tar.xz
xK-a1994865a939c6e8b83fc724b94613dce9e8c27f.zip
hid: mention Go 1.12 alternative to TLS autodetection
Diffstat (limited to 'xS/main.go')
-rw-r--r--xS/main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/xS/main.go b/xS/main.go
index cf54ab0..8fcb6c2 100644
--- a/xS/main.go
+++ b/xS/main.go
@@ -172,6 +172,10 @@ func splitString(s, delims string, ignoreEmpty bool) (result []string) {
// SSL3/TLS: <22> | <3> | xxxx xxxx
// (handshake)| (protocol version)
//
+// Note that Go 1.12's crypto/tls offers a slightly more straight-forward
+// solution: "If a client sends an initial message that does not look like TLS,
+// the server will no longer reply with an alert, and it will expose the
+// underlying net.Conn in the new field Conn of RecordHeaderError."
func detectTLS(sysconn syscall.RawConn) (isTLS bool) {
sysconn.Read(func(fd uintptr) (done bool) {
var buf [3]byte