title: maven with bouncycastle jar error
body: <p>I am using the following dependecy in my pom.xml from maven:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.bouncycastle&lt;/groupId&gt;
      &lt;artifactId&gt;bcprov-jdk15on&lt;/artifactId&gt;
      &lt;version&gt;1.55&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>After running the project inside eclipse everything is working fine.
  By using the export feature from eclipse, creating a runnable jar file, including all dependencies also everything works fine.
  No other parameters or configurations in eclipse are set.</p>
  
  <p>Only when i am running a mvn built something seems to be wrong.
  (Maven built runs without any error or warnings)
  --> Dependencies are all included.</p>
  
  <p>An error occurs in that moment when it tries to establish an https connection, the place where this bouncycastle library is used.</p>
  
  <p>Error:</p>
  
  <pre><code>javax.net.ssl.SSLException: java.security.ProviderException: Could not derive key
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
          at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:553)
          at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:412)
          at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
          at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:328)
          at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
          at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
          at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
          at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
          at plugin.KITIlias.executePost(KITIlias.java:117)
          at plugin.KITIlias.login(KITIlias.java:45)
          at control.IliasManager.login(IliasManager.java:27)
          at control.IliasStarter.login(IliasStarter.java:31)
          at control.LoginProvider$1.run(LoginProvider.java:56)
          at java.lang.Thread.run(Unknown Source)
  Caused by: java.security.ProviderException: Could not derive key
          at sun.security.ec.ECDHKeyAgreement.engineGenerateSecret(ECDHKeyAgreement.java:133)
          at sun.security.ec.ECDHKeyAgreement.engineGenerateSecret(ECDHKeyAgreement.java:163)
          at javax.crypto.KeyAgreement.generateSecret(KeyAgreement.java:648)
          at sun.security.ssl.ECDHCrypt.getAgreedSecret(Unknown Source)
          at sun.security.ssl.ClientHandshaker.serverHelloDone(Unknown Source)
          at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
          at sun.security.ssl.Handshaker.processLoop(Unknown Source)
          at sun.security.ssl.Handshaker.process_record(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          ... 16 more
  Caused by: java.security.InvalidAlgorithmParameterException
          at sun.security.ec.ECDHKeyAgreement.deriveKey(Native Method)
          at sun.security.ec.ECDHKeyAgreement.engineGenerateSecret(ECDHKeyAgreement.java:130)
          ... 25 more
  Exception in thread "Thread-4" java.lang.NullPointerException
          at plugin.KITIlias.executePost(KITIlias.java:125)
          at plugin.KITIlias.login(KITIlias.java:45)
          at control.IliasManager.login(IliasManager.java:27)
          at control.IliasStarter.login(IliasStarter.java:31)
          at control.LoginProvider$1.run(LoginProvider.java:56)
          at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>So for me it seems like something is missing during the maven built process.
  Is it required to sign one of the jars?</p>
  
  <p>my complete pom.xml is</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;X&lt;/groupId&gt;
      &lt;artifactId&gt;Y&lt;/artifactId&gt;
      &lt;version&gt;v1.1.0&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.10&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jsoup&lt;/groupId&gt;
              &lt;artifactId&gt;jsoup&lt;/artifactId&gt;
              &lt;version&gt;1.7.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
              &lt;version&gt;4.4.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;version&gt;4.5.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.controlsfx&lt;/groupId&gt;
              &lt;artifactId&gt;controlsfx&lt;/artifactId&gt;
              &lt;version&gt;8.20.8&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.bouncycastle&lt;/groupId&gt;
              &lt;artifactId&gt;bcprov-jdk15on&lt;/artifactId&gt;
              &lt;version&gt;1.55&lt;/version&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.5&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;descriptorRefs&gt;
                                  &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                              &lt;/descriptorRefs&gt;
                              &lt;archive&gt;
                                  &lt;manifest&gt;
                                      &lt;mainClass&gt;view.Dashboard&lt;/mainClass&gt;
                                  &lt;/manifest&gt;
                              &lt;/archive&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I am getting the runnable jar with:</p>
  
  <pre><code>mvn clean install
  </code></pre>
  
  <p>EDIT:
  Manifest file from eclipse export</p>
  
  <pre><code>Manifest-Version: 1.0
  Rsrc-Class-Path: ./ junit-4.10.jar hamcrest-core-1.1.jar log4j-1.2.17.
   jar jsoup-1.7.2.jar httpcore-4.4.5.jar httpclient-4.5.2.jar commons-c
   odec-1.9.jar commons-logging-1.1.1.jar controlsfx-8.20.8.jar openjfx-
   dialogs-1.0.2.jar bcprov-jdk15on-1.55.jar
  Class-Path: .
  Rsrc-Main-Class: view.Dashboard
  Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
  </code></pre>
  
  <p>-> seems like there are still dependencies to eclipse</p>