Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions defs/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"crypto/rand"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -59,6 +60,21 @@ func (s *Server) IsUp() bool {
return false
}
defer resp.Body.Close()

// Report what the connection actually negotiated. On hardware without AES
// acceleration the cipher, not the link, is what bounds the result, and
// under TLS 1.3 the server picks it: the client offers a set and has no say
// in the choice, and Go does not allow that set to be configured at all.
// Two runs can therefore differ several-fold for a reason the numbers alone
// do not show, which is what this line is for.
if resp.TLS != nil {
output.WriteDebug("Negotiated %s with %s\n",
tls.VersionName(resp.TLS.Version),
tls.CipherSuiteName(resp.TLS.CipherSuite))
} else {
output.WriteDebug("Connection is not encrypted\n")
}

b, err := io.ReadAll(resp.Body)
if err != nil || len(b) > 0 {
output.WriteDebug("Failed when parsing get IP result: %s\n", b)
Expand Down