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

Unable to get --insecure to take effect #5634

Closed
davidkarlsen opened this issue Jul 4, 2024 · 13 comments · Fixed by #5639
Closed

Unable to get --insecure to take effect #5634

davidkarlsen opened this issue Jul 4, 2024 · 13 comments · Fixed by #5639
Assignees
Labels
bug 🐛 Something is not working as should be

Comments

@davidkarlsen
Copy link

Describe the bug
We have an internal CA, and hence the cert is not trusted when running testkube cli through docker.
For ease of use I just want to ignore the issuer by using --insecure=true

To Reproduce
Steps to reproduce the behavior:

  1. Have a self-signed cert on your ingress
  2. Run docker run --rm kubeshop/testkube-cli:latest --api-uri https://testkube-ui.apps.youringress.tld/ --insecure=true --client direct run testworkflow yourworkflow -f
  3. Observe it fail:
Context:  (2.0.3)   Namespace: testkube
---------------------------------------
execute test workflow ftm-cucumber-tests from namespace testkube (error: Post "https://testkube-ui.apps.ftm-aro-dev-nore.dev.mydomain/v1/test-workflows/ftm-cucumber-tests/executions": tls: failed to verify certificate: x509: certificate signed by unknown authority)`

Expected behavior
Should ignore issuer

Version / Cluster

  • Which testkube version? 2.0.3
  • What Kubernetes cluster? (e.g. GKE, EKS, Openshift etc, local KinD, local Minikube) N/A
  • What Kubernetes version? N/A

Screenshots
If applicable, add CLI commands/output to help explain your problem.

Additional context
Add any other context about the problem here.

@davidkarlsen davidkarlsen added the bug 🐛 Something is not working as should be label Jul 4, 2024
@vsukhin vsukhin self-assigned this Jul 4, 2024
@vsukhin
Copy link
Collaborator

vsukhin commented Jul 4, 2024

@davidkarlsen will pick it up

@vsukhin
Copy link
Collaborator

vsukhin commented Jul 4, 2024

yes, we do multiple calls and one of them ignore the flag

@vsukhin
Copy link
Collaborator

vsukhin commented Jul 4, 2024

but this one call is not used in api request. so, can you try to run it locally and also for other commands like kubectl testkube get tests

@davidkarlsen
Copy link
Author

It will work "locally" - as outside of docker - because there the CA is trusted. It is the use-case as explained in the issue that fails. Also inside docker we don't provide k8s authentication.

@vsukhin
Copy link
Collaborator

vsukhin commented Jul 4, 2024

okay, what about get command?

@vsukhin
Copy link
Collaborator

vsukhin commented Jul 4, 2024

And flag is passed to cli if it's executed in docker, Do you have any url to test, it can be not testkube one, any web site just signed with the same cert?
you can also try curl -k v1/info, but most likely it will not work, because your server requires client certs

@davidkarlsen
Copy link
Author

sure - flags are passed - as demonstrated in the initial reporting.
curl passes just fine with -k using https://hub.docker.com/r/curlimages/curl
PS: No client-cert here - the core of this issue is to have testkube's http client ignore server-side issuer of cert.

@davidkarlsen
Copy link
Author

davidkarlsen commented Jul 4, 2024

okay, what about get command?

get testworkflow ftm-cucumber-tests will yield same error: "tls: failed to verify certificate: x509: certificate signed by unknown authority"

@davidkarlsen
Copy link
Author

BTW: I noticed the distro is musl based - it is notoriously known for it's flaws - do you statically compile the cmd line?

@vsukhin
Copy link
Collaborator

vsukhin commented Jul 4, 2024

yes, cmd line is statically compiled, but it uses system libraries. but good question. @ypoplavs do we have anywhere self signed ingress to test? @ypoplavs do we miss RUN apk --no-cache add ca-certificates libssl1.1 ?

@davidkarlsen
Copy link
Author

yes, cmd line is statically compiled, but it uses system libraries. but good question. @ypoplavs do we have anywhere self signed ingress to test? @ypoplavs do we miss RUN apk --no-cache add ca-certificates libssl1.1 ?

probably both of these are in place since:

  1. if you depend on the system-libraries, and they are not present, it would break before the handshake
  2. ca-certificates aren't really relevant here as it is an internal-issues cert, i.e. not depending on standard bundles

@vsukhin
Copy link
Collaborator

vsukhin commented Jul 5, 2024

we tested it out on self signed ingress, souds like it's distro related issuue. investigating what is missing

@vsukhin vsukhin mentioned this issue Jul 5, 2024
6 tasks
@vsukhin
Copy link
Collaborator

vsukhin commented Jul 5, 2024

found the bug #5639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something is not working as should be
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants