Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-24658

ssh-agent fails with "JCE cannot authenticate the provider BC" on slave

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • ssh-agent-plugin
    • None
    • Ubuntu 14.04
      Java 8

      An issue similar to this has been logged as JENKINS-18897. I've looked through that ticket but haven't found any way to resolve the issue we are seeing.

      We are using 2 git repositories. The ssh-agent works fine with one but with another we are seeing the following error:

      ssh-agent] Using credentials git (Stash System Key)
      [ssh-agent] Looking for ssh-agent implementation...
      [ssh-agent]   Java/JNR ssh-agent
      [ssh-agent] Unable to read key: exception using cipher - please check password and data.
      org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.
      	at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source)
      	at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source)
      	at org.bouncycastle.openssl.PEMReader$KeyPairParser.readKeyPair(Unknown Source)
      	at org.bouncycastle.openssl.PEMReader$RSAKeyPairParser.parseObject(Unknown Source)
      	at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source)
      	at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:92)
      	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:483)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:309)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:290)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:249)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC
      	at javax.crypto.Cipher.getInstance(Cipher.java:652)
      	... 21 more
      Caused by: java.util.jar.JarException: Class is on the bootclasspath
      	at javax.crypto.JarVerifier.verify(JarVerifier.java:247)
      	at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:160)
      	at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:186)
      	at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98)
      	at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:225)
      	at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:116)
      	at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:96)
      	at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:81)
      	at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:78)
      	... 15 more
      [ssh-agent] Started.
      

      We use separate keys for each repo.

            Unassigned Unassigned
            robmoore robmoore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: