BouncyCastle not registered, using the default JCE provider

3,477 views
Skip to the first unread message

Krishnan Mahadevan

unread,
11 Dec 2012, 10:15:3111/12/2012
to sshj-...@googlegroups.com
Hi,

I am having a very weird problem with sshj.

When running my test code from within eclipse [mine is a Maven project], I dont have any issues at all.

But the moment I try to convert my project into an assembly jar and then try to run it from the command prompt, I see this :

Dec 11, 2012 8:30:58 PM net.schmizz.sshj.common.SecurityUtils$BouncyCastleRegistration run
INFO: Trying to register BouncyCastle as a JCE provider
Dec 11, 2012 8:30:58 PM net.schmizz.sshj.common.SecurityUtils register
INFO: BouncyCastle not registered, using the default JCE provider
Dec 11, 2012 8:30:58 PM com.paypal.test.bluefin.ClientConnectionManager getClient
INFO: User name : krmahadevan
Known Hosts File location : C:\Users\krmahadevan\.ssh\known_hosts
Public Key Location location :
C:\Users\krmahadevan\.ssh\id_dsa
C:\Users\krmahadevan\.ssh\id_rsa

Dec 11, 2012 8:30:58 PM net.schmizz.sshj.transport.TransportImpl init
INFO: Client identity string: SSH-2.0-SSHJ_0_6_0
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.TransportImpl init
INFO: Server identity string: SSH-1.99-OpenSSH_4.3
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.KeyExchanger sendKexInit
INFO: Sending SSH_MSG_KEXINIT
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.KeyExchanger handle
INFO: Received SSH_MSG_KEXINIT
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.kex.AbstractDHG init
INFO: Sending SSH_MSG_KEXDH_INIT
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.KeyExchanger handle
INFO: Received kex followup data
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.kex.AbstractDHG next
INFO: Received SSH_MSG_KEXDH_REPLY
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.KeyExchanger sendNewKeys
INFO: Sending SSH_MSG_NEWKEYS
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.transport.KeyExchanger handle
INFO: Received SSH_MSG_NEWKEYS
Dec 11, 2012 8:30:59 PM net.schmizz.sshj.SSHClient doKex
INFO: Key exchange took 0.571 seconds
net.schmizz.sshj.common.SSHException: No provider available for OpenSSH key file


Any idea what might be going wrong ? I manually checked my assembly jar and I do see the bouncy-castle jar part of my assembly jar [ One of the observations made in this issue https://github.com/shikhar/sshj/issues/36 was hinting at Bouncy castle jar missing ]

Here's how my dependencies looks like :

<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>net.schmizz</groupId>
<artifactId>sshj</artifactId>
<version>0.6.0</version>
</dependency>

</dependencies>


I have wrecked my brains the whole day and I still CANNOT figure out what is going wrong.


Krishnan Mahadevan

unread,
13 Dec 2012, 04:19:0713/12/2012
to sshj-...@googlegroups.com
Any takers for this question ? 

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

Krishnan Mahadevan

unread,
14 Feb 2013, 01:50:4614/02/2013
to sshj-...@googlegroups.com
Since I didn't hear anything on this thread, I decided to skip using sshj and moved over to using "JSch" and got it done.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



Timmy Schweer

unread,
21 Mar 2013, 06:46:3821/03/2013
to sshj-...@googlegroups.com
You have to activate bouncycastle on your tomcat server. For security reasons this by standard not allowed by deployed WARs so copying "bcpkix-jdk15on-1.48.jar" and "bcprov-jdk15on-1.48.jar" to the "tomcat6/common" directory would do the trick!

Krishnan Mahadevan

unread,
21 Mar 2013, 12:09:2221/03/2013
to sshj-...@googlegroups.com
Timmy,
There are NO tom cat servers involved here because mine is NOT a web application but is a simple plain standalone java application built using Maven.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



On Thu, Mar 21, 2013 at 4:16 PM, Timmy Schweer <timmys...@gmail.com> wrote:
You have to activate bouncycastle on your tomcat server. For security reasons this by standard not allowed by deployed WARs so copying "bcpkix-jdk15on-1.48.jar" and "bcprov-jdk15on-1.48.jar" to the "tomcat6/common" directory would do the trick!

--
You received this message because you are subscribed to a topic in the Google Groups "sshj-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sshj-users/LozguMPWCYc/unsubscribe?hl=en-GB.
To unsubscribe from this group and all of its topics, send an email to sshj-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Timmy Schweer

unread,
22 Mar 2013, 06:29:2222/03/2013
to sshj-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages