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
|
|
@ -63,6 +63,9 @@ func TestHandlerWorkingAsIntended(t *testing.T) {
|
|||
NewResolver: func() model.Resolver {
|
||||
return netxlite.NewUnwrappedStdlibResolver()
|
||||
},
|
||||
NewTLSHandshaker: func() model.TLSHandshaker {
|
||||
return netxlite.NewTLSHandshakerStdlib(model.DiscardLogger)
|
||||
},
|
||||
}
|
||||
srv := httptest.NewServer(handler)
|
||||
defer srv.Close()
|
||||
|
|
@ -76,25 +79,37 @@ func TestHandlerWorkingAsIntended(t *testing.T) {
|
|||
parseBody bool
|
||||
}
|
||||
expectations := []expectationSpec{{
|
||||
name: "check for invalid method",
|
||||
reqMethod: "GET",
|
||||
respStatusCode: 400,
|
||||
name: "check for invalid method",
|
||||
reqMethod: "GET",
|
||||
reqContentType: "",
|
||||
reqBody: "",
|
||||
respStatusCode: 400,
|
||||
respContentType: "",
|
||||
parseBody: false,
|
||||
}, {
|
||||
name: "check for invalid content-type",
|
||||
reqMethod: "POST",
|
||||
respStatusCode: 400,
|
||||
name: "check for invalid content-type",
|
||||
reqMethod: "POST",
|
||||
reqContentType: "",
|
||||
reqBody: "",
|
||||
respStatusCode: 400,
|
||||
respContentType: "",
|
||||
parseBody: false,
|
||||
}, {
|
||||
name: "check for invalid request body",
|
||||
reqMethod: "POST",
|
||||
reqContentType: "application/json",
|
||||
reqBody: "{",
|
||||
respStatusCode: 400,
|
||||
name: "check for invalid request body",
|
||||
reqMethod: "POST",
|
||||
reqContentType: "application/json",
|
||||
reqBody: "{",
|
||||
respStatusCode: 400,
|
||||
respContentType: "",
|
||||
parseBody: false,
|
||||
}, {
|
||||
name: "with measurement failure",
|
||||
reqMethod: "POST",
|
||||
reqContentType: "application/json",
|
||||
reqBody: `{"http_request": "http://[::1]aaaa"}`,
|
||||
respStatusCode: 400,
|
||||
name: "with measurement failure",
|
||||
reqMethod: "POST",
|
||||
reqContentType: "application/json",
|
||||
reqBody: `{"http_request": "http://[::1]aaaa"}`,
|
||||
respStatusCode: 400,
|
||||
respContentType: "",
|
||||
parseBody: false,
|
||||
}, {
|
||||
name: "with reasonably good request",
|
||||
reqMethod: "POST",
|
||||
|
|
|
|||
Loading…
Reference in a new issue