Hi,
I have a client side certificate (Public Key Certificate) file which is to be passed in Gatling 2.1.7 script running in JDK 1.7.0_79 on Windows 7
I checked the .cer file. It has the public key in it.
I have created a new JKS using below command
keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048.
Password for both the keystore and key is same i.e. “password”
Have added the .cer file using below command
keytool -import -trustcacerts -alias root -file myappPK.cer -keystore keystore.jks
When prompted, Trust Certificate, I entered Yes
And have specified it in the following config
ssl {
trustStore {
#type = “”
#file = “”
#password = “”
#algorithm = “”
}
keyStore {
type = “jks”
file = “c:\data\programs\gatling\2.1.7\user-files\Certificates\new5\keystore.jks”
password = “password”
#algorithm = “”
}
}
I am getting below error
17:06:27.586 [DEBUG] i.g.h.a.AsyncHandler - Request ‘LoginWithCert’ failed for user 5308633530546473736-0
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196) ~[na:1.7.0_79]
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268) ~[na:1.7.0_79]
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380) ~[na:1.7.0_79]
… 32 common frames omitted
Wrapped by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targe
t
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385) ~[na:1.7.0_79]
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) ~[na:1.7.0_79]
at sun.security.validator.Validator.validate(Validator.java:260) ~[na:1.7.0_79]
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326) ~[na:1.7.0_79]
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:283) ~[na:1.7.0_79]
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:138) ~[na:1.7.0_79]
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1433) ~[na:1.7.0_79]
… 26 common frames omitted
Wrapped by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.7.0_79]
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1703) ~[na:1.7.0_79]
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:281) ~[na:1.7.0_79]
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273) ~[na:1.7.0_79]
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1446) ~[na:1.7.0_79]
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209) ~[na:1.7.0_79]
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:901) ~[na:1.7.0_79]
at sun.security.ssl.Handshaker$1.run(Handshaker.java:841) ~[na:1.7.0_79]
at sun.security.ssl.Handshaker$1.run(Handshaker.java:839) ~[na:1.7.0_79]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_79]
at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1273) ~[na:1.7.0_79]
at org.jboss.netty.handler.ssl.SslHandler.runDelegatedTasks(SslHandler.java:1392) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1255) [netty-3.10.4.Final.jar:na]
… 18 common frames omitted
Wrapped by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1336) ~[na:1.7.0_79]
at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:519) ~[na:1.7.0_79]
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:796) ~[na:1.7.0_79]
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:764) ~[na:1.7.0_79]
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624) ~[na:1.7.0_79]
at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1218) [netty-3.10.4.Final.jar:na]
… 18 common frames omitted
Wrapped by: java.net.ConnectException: General SSLEngine problem
at com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:133) [async-http-client-1.9.30.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener.access$200(NettyConnectListener.java:37) [async-http-client-1.9.30.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener$1.operationComplete(NettyConnectListener.java:104) [async-http-client-1.9.30.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:409) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:395) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.setFailure(DefaultChannelFuture.java:362) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1460) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1314) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:852) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:310) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.10.4.Final.jar:na]
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [netty-3.10.4.Final.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
17:06:27.599 [WARN ] i.g.h.a.AsyncHandlerActor - Request ‘LoginWithCert’ failed: java.net.ConnectException: General SSLEngine problem
17:06:27.608 [TRACE] i.g.h.a.AsyncHandlerActor -
Request:
LoginWithCert: KO java.net.ConnectException: General SSLEngine problem