title: spotify/dockerfile-maven plugin: Could not build image: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection
body: <p>maven-plugin to build my docker image.</p>
  
  <p>Whenever I run <code>dockerfile:build</code> </p>
  
  <p>I always get this error :</p>
  
  <pre><code>"failed to execute goal com.spotify:dockerfile-maven-plugin:1.3.6:build (default-cli) on project XXX: Could not build image"
  "Caused by: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?"
  </code></pre>
  
  <p>I will include the error log in the end.</p>
  
  <p>Would you please take a look on what is wrong here?</p>
  
  <p>This is the pom.xml file I am using for this plugin.</p>
  
  <pre><code>&lt;plugin&gt;
          &lt;groupId&gt;com.spotify&lt;/groupId&gt;
          &lt;artifactId&gt;dockerfile-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.3.6&lt;/version&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;default&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;build&lt;/goal&gt;
                      &lt;goal&gt;push&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
              &lt;repository&gt;company/imagename&lt;/repository&gt;
              &lt;tag&gt;${project.version}&lt;/tag&gt;
          &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>The docker version is : 17.06.2-ce</p>
  
  <p>OS: Windows 10.</p>
  
  <p>I checked "general--Expose daemon on tcp://localhost:2375" and also add insecure registries in the docker for windows.</p>
  
  <p>I also add DOCKER_HOST="tcp://localhost:2375" and DOCKER_CERT_PATH in my system variables.</p>
  
  <p>Error log after dockerfile-build:</p>
  
  <pre><code>org.apache.maven.plugin.MojoExecutionException: Could not build image
  at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:185)
  at com.spotify.plugin.dockerfile.BuildMojo.execute(BuildMojo.java:105)
  at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute(AbstractDockerMojo.java:240)
  at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute(AbstractDockerMojo.java:229)
  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
  at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
  at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
  at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
  at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
  at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
  at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
  at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
  Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
  at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:2512)
  at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2443)
  at com.spotify.docker.client.DefaultDockerClient.version(DefaultDockerClient.java:501)
  at com.spotify.docker.client.DefaultDockerClient.authRegistryHeader(DefaultDockerClient.java:2555)
  at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:1396)
  at com.spotify.docker.client.DefaultDockerClient.build(DefaultDockerClient.java:1365)
  at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:178)
  ... 26 more
  Caused by: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: **javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?**
  at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
  at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
  at jersey.repackaged.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
  at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2441)
  ... 31 more
  Caused by: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
  at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:481)
  at org.glassfish.jersey.apache.connector.ApacheConnector$1.run(ApacheConnector.java:491)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  .....
  </code></pre>