Skip to main content
Mock APIs in WireMock Cloud work over HTTPS with no setup, but they can’t require a client certificate, so they can’t test mutual TLS (mTLS). To record from an API that requires mTLS, use the WireMock CLI with your client certificate.

HTTPS on WireMock Cloud mock APIs

Every mock API hosted in WireMock Cloud can be called over both HTTPS and HTTP at its base URL, for example https://my-mock-api.wiremockapi.cloud. There is no certificate to configure.

Mutual TLS on mock APIs

Mock APIs don’t request a client certificate from callers, so they can’t verify mutual TLS, whether hosted in WireMock Cloud or run locally with the CLI or Runner. To control who can call a hosted mock API, use HTTP Basic, header match or OpenID Connect authentication instead - see Mock API security. If your test needs the mock to require a client certificate, run WireMock OSS with client certificate verification enabled.

Serving local mock APIs over HTTPS

When you run mock APIs locally with the WireMock CLI or in your own infrastructure with the WireMock Runner, you can serve them over HTTPS with your own certificate. Add an https section to the service in .wiremock/wiremock.yaml:
The certificate can be a PEM file containing the private key and X509 certificate, or a PKCS12 or JKS keystore. You can also set one certificate for all services under global.https. If no certificate is configured, WireMock’s default self-signed certificate is used. See TLS/HTTPS configuration for every option.

Recording from an API that requires mutual TLS

Recording in WireMock Cloud can’t present a client certificate, so to record from an API that requires mutual TLS, use the WireMock CLI. Pass a PEM file containing the private key and X509 certificate:
Or pass a password-protected PKCS12 keystore:
The same options work with wiremock record-many. See Recording via the CLI and Multi-domain recording for details.