Pass SSL certificate with ZAP

29 views
Skip to first unread message

Ben Reger

unread,
Oct 28, 2025, 11:24:42 AM (9 days ago) Oct 28
to ZAP User Group
Hey together,

The application I want to scan via ZAP need a ssl certificate. I use ZAP in a docker container which I start via a GitHub workflow. Do you know any way to pass a ssl certificate?

Kind regards,
Ben

Ben R

unread,
Oct 29, 2025, 10:11:18 AM (8 days ago) Oct 29
to ZAP User Group
I have a small addition. This is part of my GitHub workflow where I want to use ZAP. However, I'm not sure if I've implemented the certificate transfer correctly. The certificate and passphrase are stored as secrets in GitHub.

      # ── ZAP Baseline
      - name: ZAP Baseline Scan
        if: ${{ inputs.scan_type == 'baseline' }}
        uses: zaproxy/action-...@v0.14.0
        with:
          docker_name: ${{ env.DOCKER_IMAGE }}
          target: ${{ inputs.target }}
          cmd_options: >
            ${{ env.CMD_OPTIONS_BASE }}
            ${{ inputs.use_client_cert != 'false' && format(
              '-z "-config certificate.use=true -config certificate.pkcs12.path={0} -config certificate.pkcs12.password={1} -config certificate.persist=false"',
              steps.cert.outputs.cert_cont_path,
              secrets.ZAP_CLIENT_CERT_PASS
            ) || '' }}

James L

unread,
Oct 31, 2025, 11:58:31 AM (6 days ago) Oct 31
to ZAP User Group

Hey Ben,

You might want to try using the -configfile option instead of passing the cert through cmd_options. I use it to point ZAP to a small config file (for example zap.conf) that contains lines like:

certificate.use=true certificate.pkcs12.path=/zap/wrk/client.p12 certificate.pkcs12.password=changeme

That way ZAP loads all your settings at startup, and you don’t have to deal with long quoted -config strings in the workflow. It’s worked well for me in CI setups like GitHub Actions.

Cheers,
James

Simon Bennetts

unread,
Nov 3, 2025, 6:28:28 AM (3 days ago) Nov 3
to ZAP User Group

This allows you to specify the config options directly in the plan.
You can test it with the ZAP Desktop, that way you should be able to work out if the settings are doing what you need.

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages