Hi,
I am trying to make https run in Wiremock mocking server with Android. Android supports 'BKS' keystore type instead of 'JKS' .
Wiremock is using Jetty Server which should provide this keystore type internally . Wiremock is using the storetype which is returned by default KeyStore.getDefaultType(), which is good. see here
But there has to be a way by which Jetty Server used by Wiremock can be configured to use 'BKS' key store type.
In a standalone Jetty Server, this setting can be changed in a file like jetty-ssl-context.xml. with property
<Set name="KeyStoreType"><Property name="jetty.sslContext.keyStoreType" default="BKS"/></Set>
I have been walking through the source code of wiremock to see where this file is present or if its exposed for changes. Not been very successful so far. If there is any clue on how to change this setting, it would help me save a lot of time. Any other suggestion is also welcome.
For reference, here is error stack
Caused by: java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found
at java.security.KeyStore.getInstance(KeyStore.java:119)
at org.eclipse.jetty.util.security.CertificateUtils.getKeyStore(CertificateUtils.java:52)
at org.eclipse.jetty.util.ssl.SslContextFactory.loadKeyStore(SslContextFactory.java:871)
at org.eclipse.jetty.util.ssl.SslContextFactory.doStart(SslContextFactory.java:273)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.SslConnectionFactory.doStart(SslConnectionFactory.java:64)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:256)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:366)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServer.start(JettyHttpServer.java:101)
Thanks
javax.net.ssl.SSLHandshakeException. Basically, the Jetty server stops right away when handshake happens between client and server. I have investigated a lot about how the handshake works between client and server and what role does certificate play. I have made sure that BKS keystore is read successfully . Also implemented the suggestions by Android to train the HttpsUrlConnection to trust the certificate as provided by a custom CA (in my case generated by openssl tool). I am still getting the same error. @Marius, I am not sure if you ever got this issue during your investigation. If yes, please let me know if I am missing anything.
Thanks for posting your reply.
sslParams.setEndpointIdentificationAlgorithm(_endpointIdentificationAlgorithm);
WireMock is running with ssl. https://localhost:8080/__admin is working fine.
--
You received this message because you are subscribed to a topic in the Google Groups "wiremock-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wiremock-user/oDExHctRPCc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wiremock-use...@googlegroups.com.
To post to this group, send email to wiremo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wiremock-user/15ed39e2-784e-49f3-8be8-aac0bc38e8b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.