Get NullPointerException when start wiremock with -https-truststore=, need help

94 views
Skip to first unread message

winnie lee

unread,
Aug 18, 2016, 6:33:47 PM8/18/16
to wiremock-user
I created a client cert using the following command line:
keytool -genkeypair -keystore cli.jks -storepass password -alias cli -keypass password

[root@vm51lnx0146 wiremock]#  keytool -list -v -keystore ./cli.jks
Enter keystore password:  

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: cli
Creation date: Aug 18, 2016
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=testuser, OU=onbox, O=onbox, L=San Jose, ST=CA, C=US
Issuer: CN=testuser, OU=onbox, O=onbox, L=San Jose, ST=CA, C=US
Serial number: 28bdcd54
Valid from: Thu Aug 18 14:12:39 GMT-08:00 2016 until: Wed Nov 16 14:12:39 GMT-08:00 2016
Certificate fingerprints:
         MD5:  E0:A1:F3:81:BB:A6:9C:3A:15:28:02:1D:D3:72:88:AA
         SHA1: D7:9E:21:80:6F:BE:BB:C6:89:CA:10:DA:80:CA:9F:5B:51:0B:6C:3E
         SHA256: 69:5E:3F:51:A5:F6:8F:27:B6:CE:19:33:5B:4E:9C:FC:F1:A7:5F:71:40:DD:31:CE:E4:E4:0B:BF:1C:0A:0E:71
         Signature algorithm name: SHA1withDSA
         Version: 3

Extensions: 

#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: E4 A0 83 EE A1 C9 AD 11   09 8D E9 07 C9 52 D2 74  .............R.t
0010: 7C B7 DC B5                                        ....
]
]



*******************************************
*******************************************


When I start wiremock with this cert, it always throws a nullpointerexception, how to fix it? The server.jks works fine.
[root@vm51lnx0146 wiremock]# java -jar ./wiremock-standalone-2.1.11.jar --https-port 8123 --https-keystore ./server.jks -
-https-truststore="/home/testuser/cli.jks"  --https-require-client-cert   --verbose
2016-08-18 14:33:04.657 Verbose logging enabled
Exception in thread "main" java.lang.NullPointerException
        at com.github.tomakehurst.wiremock.common.KeyStoreSettings.loadStore(KeyStoreSettings.java:49)
        at com.github.tomakehurst.wiremock.http.HttpClientFactory.buildSSLContextWithTrustStore(HttpClientFactory.java:72)
        at com.github.tomakehurst.wiremock.http.HttpClientFactory.createClient(HttpClientFactory.java:62)
        at com.github.tomakehurst.wiremock.http.ProxyResponseRenderer.<init>(ProxyResponseRenderer.java:59)
        at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:100)
        at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:65)
        at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.main(WireMockServerRunner.java:113)
[root@vm51lnx0146 wiremock]# 



Reply all
Reply to author
Forward
0 new messages