refactor: merge tlsx into netxlite (#403)
Part of https://github.com/ooni/probe/issues/1505
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/legacy/netx/modelx"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/netx/tlsx"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
)
|
||||
|
||||
// Logger is the interface we expect from a logger
|
||||
@@ -66,7 +66,7 @@ func (h *Handler) OnMeasurement(m modelx.Measurement) {
|
||||
h.logger.Debugf(
|
||||
"TLS done: %s, %s (alpn='%s')",
|
||||
fmtError(m.TLSHandshakeDone.Error),
|
||||
tlsx.VersionString(m.TLSHandshakeDone.ConnectionState.Version),
|
||||
netxlite.TLSVersionString(m.TLSHandshakeDone.ConnectionState.Version),
|
||||
m.TLSHandshakeDone.ConnectionState.NegotiatedProtocol,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/legacy/oonitemplates"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/model"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/netx/errorx"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/netx/tlsx"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
)
|
||||
|
||||
// ExtSpec describes a data format extension
|
||||
@@ -463,12 +463,12 @@ func NewTLSHandshakesList(results oonitemplates.Results) TLSHandshakesList {
|
||||
var out TLSHandshakesList
|
||||
for _, in := range results.TLSHandshakes {
|
||||
out = append(out, TLSHandshake{
|
||||
CipherSuite: tlsx.CipherSuiteString(in.ConnectionState.CipherSuite),
|
||||
CipherSuite: netxlite.TLSCipherSuiteString(in.ConnectionState.CipherSuite),
|
||||
Failure: makeFailure(in.Error),
|
||||
NegotiatedProtocol: in.ConnectionState.NegotiatedProtocol,
|
||||
PeerCertificates: makePeerCerts(in.ConnectionState.PeerCertificates),
|
||||
T: in.DurationSinceBeginning.Seconds(),
|
||||
TLSVersion: tlsx.VersionString(in.ConnectionState.Version),
|
||||
TLSVersion: netxlite.TLSVersionString(in.ConnectionState.Version),
|
||||
})
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user