Simulations over HTTPS


Many APIs require HTTPS connections. Here is how to configure TLS in an Embedded API Simulator for simulations over HTTPS using one of the three supported configuration methods.

Cert and Key in PEM format

This is how to configure Embedded API Simulator with X.509 certificate and private key in PEM format for TLS connections:

            "classpath:test_certificate.pem", "classpath:test_private_key.pem")
            ) // these can be absolute paths, too

Passphrase-protected and encrypted private keys are currently not supported. Here is an example how to decrypt a private key in PKCS8 format using openssl (you’ll be asked to provide the passphrase):

openssl pkcs8 -in my_private_key.key -out my_private_key.pem

Cert Generated at Run-time

At run-time an Embedded API Simulator can generate and use self-signed certificate. You just have to specify the domain for which the certificate is to be:


If a fully qualified domain name is not specified then the cert is issued for localhost.

Java KeyStore (JKS)

      .with(TlsKeyStore.keyStore("classpath:apisimulator.jks") // can be absolute path, too
            .withStorePassword("storepass") // configure only if needed
            .withKeyPassword("keypass")     // configure only if needed

We would love to hear your feedback! Shoot us a quick email to [feedback at] to let us know what you think.

Happy API Simulating!