Skip to content

Instantly share code, notes, and snippets.

@Slakah
Created March 31, 2015 10:22
Show Gist options
  • Save Slakah/99e8b915abbcfcad7274 to your computer and use it in GitHub Desktop.
Save Slakah/99e8b915abbcfcad7274 to your computer and use it in GitHub Desktop.
To make gatling use the JAVA_OPTS environment variable for ssl settings, copy this into your build.sbt
// Copy JVM ssl settings to be used by gatling
val systemProps = new SystemProperties
javaOptions in Runtime ++= Seq(
mirrorProperty("javax.net.ssl.trustStore", "gatling.http.ssl.trustStore.file"),
mirrorProperty("javax.net.ssl.trustStorePassword", "gatling.http.ssl.trustStore.password"),
mirrorProperty("javax.net.ssl.keyStore", "gatling.http.ssl.keyStore.file"),
mirrorProperty("javax.net.ssl.keyStoreType", "gatling.http.ssl.keyStore.type"),
mirrorProperty("javax.net.ssl.keyStorePassword", "gatling.http.ssl.keyStore.password")
).flatten
def mirrorProperty(src: String, dest: String): Option[String] = {
val formatProperty = (key: String) => (value: String) => s"-D$key=$value"
systemProps.get(src).map(formatProperty(dest))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment