Skip to content
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

Merged
merged 8 commits into from Sep 27, 2023
Merged

/cacert endpoint #435

merged 8 commits into from Sep 27, 2023

Conversation

mmatczuk
Copy link
Contributor

@mmatczuk mmatczuk commented Sep 19, 2023

Fixes #133

@@ -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)
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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)

@@ -23,6 +23,8 @@ const (
HttpbinServiceName = "httpbin"
)

var enabled = "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about const?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mmatczuk mmatczuk merged commit 05c282b into main Sep 27, 2023
3 checks passed
@mmatczuk mmatczuk deleted the mmt/cacert-endpoint branch September 27, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api: add /cacert endpoint serving MITM CA
2 participants