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

Troubleshoot mTLS certificates #695

Open
SVelizMquest opened this issue Jul 25, 2024 · 0 comments
Open

Troubleshoot mTLS certificates #695

SVelizMquest opened this issue Jul 25, 2024 · 0 comments

Comments

@SVelizMquest
Copy link

Question

I'm trying to run a Vegeta attack using certificates for mTLS with the following structure:

echo "POST https://127.0.0.1:8443/eir" | vegeta attack \
  -body=[PATHTOFILE]/testVegeta \
  -cert=[PATHTOFILE]/http_client.crt \
  -duration=30s \
  -http2=true \
  -key=[PATHTOFILE]/http_client.key \
  -max-workers=1 \
  -rate=50/1s \
  -root-certs=[PATHTOFILE]/api_ca.crt | vegeta report

Which is (i think) the equivalent to the following CURL command that does work:

curl -X POST "https://127.0.0.1:8443/eir" \
  -H "Content-type:application/json" \
  -d '{[REQUEST BODY IN testVegeta]}' \
  --cacert [PATHTOFILE]/api/api_ca.crt \
  --cert [PATHTOFILE]/http_client.crt \
  --key [PATHTOFILE]/http_client.key

I'm facing weird problems with Vegeta:

  1. The testVegeta file throws "permission denied" when trying to open it unless I leave a space between the "=" and the route. example: '-body= [PATHTOFILE]/testVegeta `. When there isn't a space, it also throws another error that it can't detect the encoding for stdin.
  2. Even though they are the exact same certificates, the vegeta requests (when working with the space mentioned in the previous point) throws a http: TLS handshake error from 127.0.0.1:36861: remote error: tls: bad certificate from the server.

I'm using Ubuntu 23.10.
Is this a bug, or is there a mistake in my configurations?
Is there a way to see if Vegeta is opening the files correctly, or a "verbose" option?
Any insight is appreciated.

@SVelizMquest SVelizMquest changed the title Troubleshoot certificates Troubleshoot mTLS certificates Jul 25, 2024
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

No branches or pull requests

1 participant