feat(oohelperd): measure TLS for :443 endpoints (#886)

This diff improves oohelperd to measure :443 endpoints with TLS.

Part of https://github.com/ooni/probe/issues/2237.
This commit is contained in:
Simone Basso
2022-08-28 14:34:40 +02:00
committed by GitHub
parent df0e099b73
commit 1e7384d1cc
10 changed files with 143 additions and 35 deletions
@@ -9,6 +9,9 @@ import (
"github.com/ooni/probe-cli/v3/internal/netxlite"
)
// TODO(bassosimone): these struct definitions should be moved outside the
// specific implementation of Web Connectivity v0.4.
// ControlRequest is the request that we send to the control
type ControlRequest struct {
HTTPRequest string `json:"http_request"`
@@ -23,6 +26,14 @@ type ControlTCPConnectResult struct {
Failure *string `json:"failure"`
}
// ControlTLSHandshakeResult is the result of the TLS handshake
// attempt performed by the control vantage point.
type ControlTLSHandshakeResult struct {
ServerName string `json:"server_name"`
Status bool `json:"status"`
Failure *string `json:"failure"`
}
// ControlHTTPRequestResult is the result of the HTTP request
// performed by the control vantage point.
type ControlHTTPRequestResult struct {
@@ -67,14 +78,19 @@ const (
// ControlIPInfoFlagIsBogon indicates that the address is a bogon
ControlIPInfoFlagIsBogon
// ControlIPInfoFlagValidForDomain indicates that an IP address
// is valid for the domain because it works with TLS
ControlIPInfoFlagValidForDomain
)
// ControlResponse is the response from the control service.
type ControlResponse struct {
TCPConnect map[string]ControlTCPConnectResult `json:"tcp_connect"`
HTTPRequest ControlHTTPRequestResult `json:"http_request"`
DNS ControlDNSResult `json:"dns"`
IPInfo map[string]*ControlIPInfo `json:"ip_info"`
TCPConnect map[string]ControlTCPConnectResult `json:"tcp_connect"`
TLSHandshake map[string]ControlTLSHandshakeResult `json:"tls_handshake"`
HTTPRequest ControlHTTPRequestResult `json:"http_request"`
DNS ControlDNSResult `json:"dns"`
IPInfo map[string]*ControlIPInfo `json:"ip_info"`
}
// Control performs the control request and returns the response.