New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/cacert endpoint #435
/cacert endpoint #435
Conversation
e2e/tests/flag_test.go
Outdated
@@ -97,6 +98,24 @@ func TestFlagMITM(t *testing.T) { | |||
ExpectHeader("test-resp-add", "test-resp-value") | |||
} | |||
|
|||
func TestFlagMITMGenCA(t *testing.T) { | |||
r := newClient(t, proxyAPI).GET("/cacert").ExpectStatus(http.StatusOK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably does not make a difference here, but the client forwards all the traffic to the proxy by default. Maybe we could add some opt direct
that erases proxy function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ie to erase proxy function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, erase proxy function from transport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
r := newClient(t, proxyAPI, func(tr *http.Transport) {
tr.Proxy = nil
}).GET("/cacert").ExpectStatus(http.StatusOK)
e2e/forwarder/service.go
Outdated
@@ -23,6 +23,8 @@ const ( | |||
HttpbinServiceName = "httpbin" | |||
) | |||
|
|||
var enabled = "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This refactors apiEndpoint to more generic list that can be modified by different code blocks.
This tests both certificate generation and /cacert api endpoint.
7aa04ee
to
36203af
Compare
Fixes #133