Skip to content

Pass client certificates as CLI flags #2603

@hem-source

Description

@hem-source

Brief summary

I have my certificate present on path

  • export MTLS_PEM=“$(”)"
  • echo $MTLS_PEM | sed ‘s/\n/\n/g’ > /mtls.pem
  • export MTLS_KEY=“$(”)"
  • echo $MTLS_KEY | sed ‘s/\n/\n/g’ > /mtls.key
    I want to load this certificate with performing k6 run
    k6 run --summary-export=load-performance.json $file --config=src/test/performance/config.json.

How do i load this certificate ?

k6 run --summary-export=load-performance.json --ssl-client-cert mtls.pem --ssl-client-key mtls.key $file --config=/config.json;

Is it possible to use --ssl-cleint-cert such type to call certificate?

Also the main issue is , when were we run performance test for process API our test result showed failed . PFB error . where as same pipeline is used to run experience API all results shows pass.

Process API:
✗ Status code is 200
↳ 0% — ✓ 0 / ✗ 12002
checks.....................: 0.00% ✓ 0 ✗ 12002
http_req_failed............: 100.00% ✓ 12002 ✗ 0

Experience API:
http_req_failed................: 0.00% ✓ 0 ✗ 18000

we are not able to identify why different behaviour/out put we are getting as both is using same script.?

k6 version

k6

OS

windos

Docker version and image (if applicable)

No response

Steps to reproduce the problem

NA

Expected behaviour

same script should pass all performance test successful for process API as well

Actual behaviour

Performance test is failing for process API

Metadata

Metadata

Assignees

No one assigned

    Labels

    evaluation neededproposal needs to be validated or tested before fully implementing it in k6feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions