# Received fatal alert: handshake\_failure

**URL:** <https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113>\
**Category:** Gatling (Open-Source)\
**Created:** [July 8, 2019, 4:12pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113 "2019-07-08T16:12:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_Verma](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Vikram\_Verma](https://community.gatling.io/u/Vikram_Verma)\
**Post date:** [July 8, 2019, 4:12pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/1 "2019-07-08T16:12:36Z")

</div>

I am trying to connect to oracle database but I keep facing facing SSL issue despite adding values for trust store and key store in gatling.config file. Am I missing anything from my end in terms of configuration?

Code for Scala for JDBC connection:

`  
private val dbConnectionString = “jdbc:oracle:thin:@(DESCRIPTION=(LOAD\_BALANCE=off)(FAILOVER=on)(ADDRESS\_LIST=(ADDRESS=(PROTOCOL=TCPS)(HOST= 1.2.3.4.5)(PORT=#$%$))(ADDRESS=(PROTOCOL=TCPS)(HOST= 1.2.3.4.6)(PORT=12345)))(CONNECT\_DATA=(SERVER=DEDICATED) (SERVICE\_NAME= abcdef)))”

private val sqlQuery = “SELECT \* FROM abc.def)”  
private val sqlUserName = “abc”  
private val sqlPassword = “xyzzy”  
private val message = “${DCN}”

val sqlQueryFeeder: SourceFeederBuilder[Any] = jdbcFeeder(dbConnectionString,  
sqlUserName,  
sqlPassword,  
sqlQuery  
)

`

gatling.config code for trust store and keystone

`  
http {  
ssl {  
keyStore {  
type = “JKS” # Type of SSLContext’s KeyManagers store  
file = “src/test/resources/data/keystore.jks” # Location of SSLContext’s KeyManagers store  
password = “abcdef” # Password for SSLContext’s KeyManagers store  
#algorithm = “” # Algorithm used SSLContext’s KeyManagers store  
}

trustStore {  
type = “JKS” # Type of SSLContext’s TrustManagers store  
file = “src/test/resources/data/truststore.jks” # Location of SSLContext’s TrustManagers store  
password = “abcdef” # Password for SSLContext’s TrustManagers store  
#algorithm = “” # Algorithm used by SSLContext’s TrustManagers store  
}  
}  
`

Error details:

`  
14:02:24.978 [ERROR] i.g.a.Gatling$ - Run crashed

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake\_failure

at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128)

at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)

at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308)

at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279)

at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181)

at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)

at java.base/sun.security.ssl.SSLEngineImpl.decode(SSLEngineImpl.java:672)

at java.base/sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:627)

at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:443)

at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:422)

at java.base/javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:634)

at oracle.net.nt.SSLSocketChannel.unwrap(SSLSocketChannel.java:444)

at oracle.net.nt.SSLSocketChannel.handshake(SSLSocketChannel.java:350)

at oracle.net.nt.SSLSocketChannel.write(SSLSocketChannel.java:238)

at oracle.net.ns.NIOPacket.writeToSocketChannel(NIOPacket.java:211)

at oracle.net.ns.NIOConnectPacket.writeToSocketChannel(NIOConnectPacket.java:232)

at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:108)

… 27 common frames omitted

Wrapped by: java.io.IOException: Received fatal alert: handshake\_failure, connect lapse 201 ms.

at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:138)

at oracle.net.ns.NSProtocol.connect(NSProtocol.java:317)

at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)

… 24 common frames omitted

Wrapped by: java.io.IOException: Received fatal alert: handshake\_failure, connect lapse 201 ms., Authentication lapse 0 ms.

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:790)

… 24 common frames omitted

Wrapped by: java.sql.SQLRecoverableException: IO Error: Received fatal alert: handshake\_failure, connect lapse 201 ms., Authentication lapse 0 ms.

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:794)

at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)

at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)

at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)

at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)

at io.gatling.jdbc.feeder.JdbcFeederSource$.apply(JdbcFeederSource.scala:30)

at io.gatling.jdbc.Predef$.jdbcFeeder(Predef.scala:26)

at computerdatabase.Extract\_JDBC.(Extract\_JDBC.scala:33)

… 16 common frames omitted

Wrapped by: java.lang.reflect.InvocationTargetException: null

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

at io.gatling.app.Runner.run0(Runner.scala:75)

at io.gatling.app.Runner.run(Runner.scala:61)

at io.gatling.app.Gatling$.start(Gatling.scala:74)

at io.gatling.app.Gatling$.fromArgs(Gatling.scala:47)

at io.gatling.app.Gatling$.main(Gatling.scala:39)

at io.gatling.app.Gatling.main(Gatling.scala)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)

at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)

java.lang.reflect.InvocationTargetException

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)

at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)

Caused by: java.lang.reflect.InvocationTargetException

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

at io.gatling.app.Runner.run0(Runner.scala:75)

at io.gatling.app.Runner.run(Runner.scala:61)

at io.gatling.app.Gatling$.start(Gatling.scala:74)

at io.gatling.app.Gatling$.fromArgs(Gatling.scala:47)

at io.gatling.app.Gatling$.main(Gatling.scala:39)

at io.gatling.app.Gatling.main(Gatling.scala)

… 6 more  
`

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [July 8, 2019, 4:31pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/2 "2019-07-08T16:31:09Z")

</div>

Check the option block you’ve configured in gatling.conf: it’s in the http namespace, there’s no reason it would have an impact on the truststore and keystore to be used for a JDBC driver.

---

<div class="post-metadata">

**Author:** ![Vikram\_Verma](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Vikram\_Verma](https://community.gatling.io/u/Vikram_Verma)\
**Post date:** [July 8, 2019, 5:05pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/3 "2019-07-08T17:05:51Z")

</div>

Hi Stephane,

I don’t see any option block in git config under http. Following is the complete http standard block which is in use at my end. It seems like the issue is linked to consumption of trust store and keystore jks, but I am not sure about that.

`

http {  
fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable  
fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable  
perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable  
warmUpUrl = “[https://gatling.io](https://gatling.io)” # The URL to use to warm-up the HTTP stack (blank means disabled)  
enableGA = true # Very light Google Analytics, please support  
ssl {  
keyStore {  
type = “” # Type of SSLContext’s KeyManagers store  
file = “” # Location of SSLContext’s KeyManagers store  
password = “” # Password for SSLContext’s KeyManagers store  
algorithm = “” # Algorithm used SSLContext’s KeyManagers store  
}  
trustStore {  
type = “” # Type of SSLContext’s TrustManagers store  
file = “” # Location of SSLContext’s TrustManagers store  
password = “” # Password for SSLContext’s TrustManagers store  
algorithm = “” # Algorithm used by SSLContext’s TrustManagers store  
}  
}

`

---

<div class="post-metadata">

**Author:** ![Vikram\_Verma](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Vikram\_Verma](https://community.gatling.io/u/Vikram_Verma)\
**Post date:** [July 8, 2019, 6:48pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/4 "2019-07-08T18:48:52Z")

</div>

It’s definitely the issue with Gatling configuration because I tried to use the same connection string and jks files with Jmeter and I am able to get the result of my sql query. Could you please help me in debugging the issue in Gatling as majority of my script is developed in Scala.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [July 8, 2019, 7:00pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/5 "2019-07-08T19:00:00Z")

</div>

Definitively not a Gatling issue.  
Read Oracle JDBC driver’s documentation and figure out how to configure TLS.

---

<div class="post-metadata">

**Author:** ![Vikram\_Verma](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Vikram\_Verma](https://community.gatling.io/u/Vikram_Verma)\
**Post date:** [July 8, 2019, 7:09pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/6 "2019-07-08T19:09:59Z")

</div>

I understand Stephane but I didn’t do anything special in terms of configuration with Jmeter either and it worked fine there. Seems like trust store and keystore are not getting picked up in Gatling which could be causing the issue but I have no confirm way of telling that. I can’t think of anything else which could be causing the issue. If someone is able to get oracle jdbc work on their system, inputs would be highly appreciated!

---

<div class="post-metadata">

**Author:** ![Vikram\_Verma](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Vikram\_Verma](https://community.gatling.io/u/Vikram_Verma)\
**Post date:** [July 9, 2019, 7:32pm UTC](https://community.gatling.io/t/received-fatal-alert-handshake-failure/5113/7 "2019-07-09T19:32:32Z")

</div>

I am still facing the same issue, could anyone help please?  
It’s the same handshake failure error over and over again ☹
