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

Fail to get events and logs by HTTP API, because of the client. #6733

Closed
neWs1587 opened this issue Sep 14, 2021 · 1 comment
Closed

Fail to get events and logs by HTTP API, because of the client. #6733

neWs1587 opened this issue Sep 14, 2021 · 1 comment
Labels

Comments

@neWs1587
Copy link

neWs1587 commented Sep 14, 2021

func (h Facade) EventStreamReader(in interface{}, path string) (*bufio.Reader, error) { method := "GET" u, err := h.url(method, path, in) if err != nil { return nil, err } req, err := http.NewRequest("GET", u.String(), nil) if err != nil { return nil, err } req.Header.Set("Accept", "text/event-stream") req.Header.Set("Authorization", h.authorization) log.Debugf("curl -H 'Accept: text/event-stream' -H 'Authorization: ******' '%v'", u) resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } err = errFromResponse(resp) if err != nil { return nil, err } return bufio.NewReader(resp.Body), nil }

As you can see, EventStreamReader uses DefaultClient, while others uses client like the one below
client := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{ InsecureSkipVerify: h.insecureSkipVerify, }, }, }

As a result, when I attempt to get the Workflow Event or workflow Logs by https with InsecureSkipVerify, it comes with an error, "x509: certificate signed by unknown authority".

@alexec
Copy link
Contributor

alexec commented Sep 20, 2021

Here is where the code change needs to be made:

https://github.com/argoproj/argo-workflows/blob/master/pkg/apiclient/http1/facade.go#L55

Would you be interested in submitting a PR to fix?

@alexec alexec added solution/workaround There's a workaround, might not be great, but exists invalid labels Sep 21, 2021
@stale stale bot removed the wontfix label Sep 21, 2021
@alexec alexec added wontfix good first issue Good for newcomers and removed solution/workaround There's a workaround, might not be great, but exists invalid labels Sep 21, 2021
NikeNano added a commit to NikeNano/argo-workflows that referenced this issue Sep 27, 2021
Signed-off-by: NikeNano <niklas.sven.hansson@gmail.com>
@alexec alexec closed this as completed in 543366f Sep 28, 2021
kriti-sc pushed a commit to kriti-sc/argo-workflows that referenced this issue Oct 24, 2021
…rgoproj#6800)

Signed-off-by: NikeNano <niklas.sven.hansson@gmail.com>
Signed-off-by: kriti-sc <kathuriakriti1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants