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

Not possible to specify client certificate in BrunoCLI #2730

Open
2 tasks done
angelaatskandia opened this issue Jul 31, 2024 · 2 comments
Open
2 tasks done

Not possible to specify client certificate in BrunoCLI #2730

angelaatskandia opened this issue Jul 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@angelaatskandia
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

In the Bruno application it is possible to configure a client certificate by defining paths to cert and key files on collection level.
However, this option seems to be missing when running BrunoCLI - one can only configure path to cacert through command line, not paths to client certificates.

This hinders from running Bruno tests in continuous testing / continuous integration environments.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

It is a bit tricky to take a screenshot of something that is missing :-)

@angelaatskandia angelaatskandia added the bug Something isn't working label Jul 31, 2024
@pietrygamat
Copy link
Contributor

In current implementation, the CA file is an application level setting, so it makes sense to have a cli switch for that. The mTLS certificates however are configured at collection level, so they are read when executing cli already, as any other request configuration. Also, the fields storing paths and passwords support variables already, so the cli invocation can be customized easily.

Would you elaborate how you expect the additional cli switches to work and what --keywords you need?

@angelaatskandia
Copy link
Author

Good to hear that it is easy to customize the cli :-)

One solution would be to read the paths, domain and phrases from the bruno.json when triggering tests from BrunoCLI.
However, the drawback would be that the paths to the certificate files might differ between local machines (where tests are developed) and CI-servers. So when the tester commits the collection, the local settings will be the ones used when running the committed tests on the pipeline server.

So a solution where paths, domain and phrases can be injected using arguments/keywords over command line would be preferable from a CI/CT perspective.
Regarding the switches, maybe reusing the ones from the application could be suitable?
Keywords could then be something like:
--domain
--clientcertfile
--clientcertkey

This would give a command like:
bru run --env test --cacert D:/rootcert.cer --domain *.company.org --clientcertfile D:/clientcert.cer --clientcertkey D:/clientcert.pem --output results.xml --format junit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants