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:
parent
df0e099b73
commit
1e7384d1cc
10 changed files with 143 additions and 35 deletions
|
|
@ -18,6 +18,9 @@ import (
|
|||
"github.com/ooni/probe-cli/v3/internal/tracex"
|
||||
)
|
||||
|
||||
// TODO(bassosimone): we should refactor the TH to use step-by-step such that we
|
||||
// can use an existing connection for the HTTP-measuring task
|
||||
|
||||
// ctrlHTTPResponse is the result of the HTTP check performed by
|
||||
// the Web Connectivity test helper.
|
||||
type ctrlHTTPResponse = webconnectivity.ControlHTTPRequestResult
|
||||
|
|
@ -51,11 +54,13 @@ func httpDo(ctx context.Context, config *httpConfig) {
|
|||
defer config.Wg.Done()
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", config.URL, nil)
|
||||
if err != nil {
|
||||
config.Out <- ctrlHTTPResponse{ // fix: emit -1 like the old test helper does
|
||||
// fix: emit -1 like the old test helper does
|
||||
config.Out <- ctrlHTTPResponse{
|
||||
BodyLength: -1,
|
||||
Failure: httpMapFailure(err),
|
||||
StatusCode: -1,
|
||||
Title: "",
|
||||
Headers: map[string]string{},
|
||||
StatusCode: -1,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
@ -73,11 +78,13 @@ func httpDo(ctx context.Context, config *httpConfig) {
|
|||
defer clnt.CloseIdleConnections()
|
||||
resp, err := clnt.Do(req)
|
||||
if err != nil {
|
||||
config.Out <- ctrlHTTPResponse{ // fix: emit -1 like old test helper does
|
||||
// fix: emit -1 like the old test helper does
|
||||
config.Out <- ctrlHTTPResponse{
|
||||
BodyLength: -1,
|
||||
Failure: httpMapFailure(err),
|
||||
StatusCode: -1,
|
||||
Title: "",
|
||||
Headers: map[string]string{},
|
||||
StatusCode: -1,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue