Change keystore type to JKS

Change-Id: I8cdb7a22d9bec61906b6a9acd409079cd6dd2dcf
This commit is contained in:
Piotr Fus 2018-01-30 11:09:21 +01:00
parent 0b7d0b52bc
commit 4d4d303d58
2 changed files with 4 additions and 6 deletions

View file

@ -27,6 +27,7 @@ import pl.touk.mockserver.client.MockDoesNotExist
import pl.touk.mockserver.client.RemoteMockServer
import pl.touk.mockserver.client.Util
import pl.touk.mockserver.server.HttpMockServer
import spock.lang.AutoCleanup
import spock.lang.Shared
import spock.lang.Specification
@ -34,6 +35,7 @@ class MockServerIntegrationTest extends Specification {
RemoteMockServer remoteMockServer
@AutoCleanup('stop')
HttpMockServer httpMockServer
@Shared
@ -44,10 +46,6 @@ class MockServerIntegrationTest extends Specification {
remoteMockServer = new RemoteMockServer('localhost', 9000)
}
def cleanup() {
httpMockServer.stop()
}
def "should add working rest mock on endpoint"() {
expect:
remoteMockServer.addMock(new AddMock(

View file

@ -54,7 +54,7 @@ class HttpServerWrapper {
}
private KeyManager[] buildKeyManager(Https https) {
KeyStore keyStore = KeyStore.getInstance(KeyStore.defaultType)
KeyStore keyStore = KeyStore.getInstance('jks')
keyStore.load(new FileInputStream(https.keystorePath), https.keystorePassword.toCharArray())
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.defaultAlgorithm)
kmf.init(keyStore, https.keyPassword.toCharArray())
@ -63,7 +63,7 @@ class HttpServerWrapper {
private TrustManager[] buildTrustManager(Https https) {
if (https.requireClientAuth) {
KeyStore trustStore = KeyStore.getInstance(KeyStore.defaultType)
KeyStore trustStore = KeyStore.getInstance('jks')
trustStore.load(new FileInputStream(https.truststorePath), https.truststorePassword.toCharArray())
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.defaultAlgorithm)
tmf.init(trustStore)