SSL certificates and gatling

Hi guys.
I have a private server which provides some api. Also I have a *.p12 certificate file for signing requests to private api. How can I prepare gatling to use this certificate for signing api requests?

Command for exporting p12 to jks: keytool -importkeystore -srckeystore path_to_cert_directory/certificate.p12 -destkeystore path_to_cert_directory/certificate.jks -srcstoretype pkcs12

P.S. I tried some cases of exporting p12 file to jks and gatling config but got nothing for all of they. First case gave me “Connection timed out” error. Second gave “No trusted certificate found” (see exception below)
P.S.S. gatling version is 1.5

Thanks in advance!

sun.security.validator.ValidatorException: No trusted certificate found
at sun.security.validator.SimpleValidator.buildTrustedChain(Unknown Sour
ce) ~[na:1.6.0_38]
at sun.security.validator.SimpleValidator.engineValidate(Unknown Source)
~[na:1.6.0_38]
at sun.security.validator.Validator.validate(Unknown Source) ~[na:1.6.0_
38]
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown So
urce) ~[na:1.6]
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
Unknown Source) ~[na:1.6]
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
Unknown Source) ~[na:1.6]
Wrapped by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source) ~
[na:1.6]
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(Unknown Source) ~[na
:1.6]
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source) ~[na:
1.6]
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source) ~[na:
1.6]
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unkno
wn Source) ~[na:1.6]
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
Source) ~[na:1.6]
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source) ~
[na:1.6]
at com.sun.net.ssl.internal.ssl.Handshaker$1.run(Unknown Source) ~[na:1.
6]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0
_38]
at com.sun.net.ssl.internal.ssl.Handshaker$DelegatedTask.run(Unknown Sou
rce) ~[na:1.6]

Forgot the gatling config

gatling {
core {
#outputDirectoryBaseName = “”
#runDescription = “”
#encoding = “utf-8” # encoding for every file manipulation made in gatling
#simulationClass = “”
extract {
regex {
#cache = true
}
xpath {
#cache = true
}
jsonPath {
#cache = true
}
css {
#engine = jodd # can change to jsoup
}
}
timeOut {
#simulation = 86400 # in s
#actor = 5 # in s
}
directory {
#data = user-files/data
#requestBodies = user-files/request-bodies
#simulations = user-files/simulations
#reportsOnly = “”
#binaries = “”
#results = results
}
}
charting {
#noReports = false
#maxPlotPerSeries = 1000
#accuracy = 10 # in ms
indicators {
#lowerBound = 800 # in ms
#higherBound = 1200 # in ms
#percentile1 = 95 # in percents
#percentile2 = 99 # in percents
}
}
http {
#allowPoolingConnection = true
#allowSslConnectionPool = true
#compressionEnabled = true # Set if compression should be supported or not
#connectionTimeout = 60000 # Timeout of the connection to the server (ms)
#idleConnectionInPoolTimeoutInMs = 60000
#idleConnectionTimeoutInMs = 60000
#maxConnectionLifeTimeInMs = -1 # max duration a connection can stay open
#ioThreadMultiplier = 2
#maximumConnectionsPerHost = -1
#maximumConnectionsTotal = -1
#maxRetry = 4 # number of times that a request should be tried again
#requestCompressionLevel = -1
#requestTimeoutInMs = 60000 # Timeout of the requests (ms)
#useProxyProperties = false
#userAgent = “NING/1.0”
#useRawUrl = false
#warmUpUrl = “http://goo.gl/wqthq
#rfc6265CookieEncoding = true # use rfc6265 cookie encoding style
ssl {
trustStore {
type = “JKS”
file = “C:/API_cert/certificate.jks”
password = “password”
algorithm = “”
}
keyStore {
#type = “JKS”
#file = “C:/API_cert/certificate.jks”
#password = “password”
#algorithm = “”
}
}
}
data {
#writers = “console, file”
#reader = file
console {
#light = false
}
file {
bufferSize = 8192
}
graphite {
#light = false
#host = “localhost”
#port = 2003
#rootPathPrefix = “gatling”
#bucketWidth = 100
}
}
}

I can’t reply in length for now. Key tool can’t export the private keys. You probably have to set up the keystore to use your p12 file (PKCS12 type). Check out Oracle documentation.