org.bouncycastle.openssl.EncryptionException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Get the following error when i try to run on windows slave, works fine on Master (centos). A similar issue was raised back in July but for a different configuration, JENKINS-18897. {code} [ssh-agent] Using credentials jenkins [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/tomcat-native ssh-agent ERROR: [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.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:642) ... 22 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:161) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:223) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:97) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:77) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:68) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:79) ... 16 more [ssh-agent] Started. {code} Anyway help on this would be appreciated, my Java programming is a bit outdated, more of a .net developer nowadays.
    via by Shamul Rohman,
  • Get the following error when i try to run on windows slave, works fine on Master (centos). A similar issue was raised back in July but for a different configuration, JENKINS-18897. {code} [ssh-agent] Using credentials jenkins [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/tomcat-native ssh-agent ERROR: [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.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:642) ... 22 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:161) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:223) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:97) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:77) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:68) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:79) ... 16 more [ssh-agent] Started. {code} Anyway help on this would be appreciated, my Java programming is a bit outdated, more of a .net developer nowadays.
    via by Shamul Rohman,
  • SSH Access on Cloudbees
    via Stack Overflow by sofarsogood
    ,
  • 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: {code} 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. {code} We use separate keys for each repo.
    via by robmoore,
  • 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: {code} 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. {code} We use separate keys for each repo.
    via by robmoore,
    • 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.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:642) ... 22 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:161) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:223) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:97) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:77) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:68) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:79) ... 16 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,