aboutsummaryrefslogtreecommitdiff
path: root/hid
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
commiteae39b13c2f5dcaf2a27b45f1e27041a2e5f4c40 (patch)
tree8ebec6d03ef80d59a1f1b53fe7278092e9bcd04c /hid
parent95f183aa480733d7f7f4221e91df4570433c2e89 (diff)
downloadhaven-eae39b13c2f5dcaf2a27b45f1e27041a2e5f4c40.tar.gz
haven-eae39b13c2f5dcaf2a27b45f1e27041a2e5f4c40.tar.xz
haven-eae39b13c2f5dcaf2a27b45f1e27041a2e5f4c40.zip
hid: mention Go 1.12 alternative to TLS autodetection
Diffstat (limited to 'hid')
-rw-r--r--hid/main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/hid/main.go b/hid/main.go
index cf54ab0..8fcb6c2 100644
--- a/hid/main.go
+++ b/hid/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