Hi everybody,
I am new to Rest Assured and I am experimenting with one of my favourite topics: certificate authentication.
I managed to get it working for a single request the following way:
.auth()
.certificate("keystore.jks", "password",
CertificateAuthSettings.certAuthSettings().sslSocketFactory(sslSocketFactory))
where sslSocketFactory is a custom factory that refers to a key store containing the client certificate and the standard JRE trust store.
Now I would like achieve the same result using a RequestSpecification, to avoid repeating the same ceremony for every test method.
I've used a RequestSpecBuilder with:
.setKeyStore(SSLSocketFactoryBuilder.buildKeyStore())
.setTrustStore(SSLSocketFactoryBuilder.buildTrustStore())
where the buildKeyStore and buildTrustStore return a KeyStore instance, the same used by the SSLSocketFactory in the previous snippet.
.setTrustStore works fine, but setKeyStore throws the following exception:
groovy.lang.MissingMethodException: No signature of method: io.restassured.config.SSLConfig.keyStore() is applicable for argument types: (java.security.KeyStore) values: [java.security.KeyStore@10567255]
Possible solutions: keyStore(java.lang.String), keyStore(java.io.File, java.lang.String), keyStore(java.lang.String, java.lang.String), getKeyStore(), trustStore(java.security.KeyStore)
Am I missing something or is it a bug?
Thanks in advance,
Carlo