title: Spring Kafka SSL setup in Spring boot application.yml
body: <p>I am trying to setup a Spring Boot Application with a Kafka Client to use SSL. 
  I have my keystore.jks and truststore.jks stored on a filesystem(on a docker container) because of this: <a href="https://github.com/spring-projects/spring-kafka/issues/710" rel="noreferrer">https://github.com/spring-projects/spring-kafka/issues/710</a></p>
  
  <p>Here is my application.yml:</p>
  
  <pre><code>spring:
    kafka:
        ssl:
          key-password: pass
          keystore-location: /tmp/kafka.client.keystore.jks
          keystore-password: pass
          truststore-location: /tmp/kafka.client.truststore.jks
          truststore-password: pass
  </code></pre>
  
  <p>But when I start the application ( in a docker container) it says:</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Resource 'class path resource [tmp/kafka.client.keystore.jks]' must be on a file system
  [..]
  Caused by: java.io.FileNotFoundException: class path resource [tmp/kafka.client.keystore.jks] cannot be resolved to URL because it does not exist
  </code></pre>
  
  <p>I checked on the container and the .jks are there in /tmp .</p>
  
  <p>I cannot understand how to pass .jks to spring boot. </p>
  
  <p>UPDATE <strong>06/07/2018</strong></p>
  
  <p>This is my dockerfile</p>
  
  <pre><code>FROM openjdk:8-jdk-alpine
  VOLUME /tmp
  COPY ssl/kafka.client.keystore.jks /tmp
  COPY ssl/kafka.client.truststore.jks /tmp
  ARG JAR_FILE
  ADD ${JAR_FILE} app.jar
  ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
  </code></pre>