Building SSHJ is way too difficult. Please help.

595 views
Skip to first unread message

Stefan Reich

unread,
Apr 19, 2014, 10:04:44 AM4/19/14
to sshj-...@googlegroups.com
Hi there!

I am trying to build SSHJ for inclusion in Text2GUI (http://text2gui.tinybrain.de). Let me tell you: It's hard!!!

Here are my notes:

  Satisfying the requirements for SSHJ is quite a bitch...

  JCraft was easy.
  slf4j has SO many jars to choose from...
  bouncycastle v150 (the latest) does not provide class PEMReader.
  For bouncycastle v140 I did find the "bcprov" jar, but not the "bcpkix" jar, so I took that from v150. Hope that works.

I now have these libs in the project:

-rw-rw-r-- 1 stefan stefan  598674 Dec 18 00:46 bcpkix-jdk15on-150.jar
-rw-rw-r-- 1 stefan stefan 1593423 Dec 18 00:54 bcprov-jdk15-140.jar
-rw-rw-r-- 1 stefan stefan 2732684 Dec 18 00:44 bcprov-jdk15on-150.jar
-rw-r--r-- 1 stefan stefan   26084 Mar 25  2013 slf4j-api-1.7.5.jar

I have included jzlib as source files, SSHJ also as sources.

Upshot: I can do SSH comands with password auth.

But with public key auth I'm getting these errors:

User: root. Password: Exception in thread "main" net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
    at net.schmizz.sshj.SSHClient.auth(SSHClient.java:217)
    at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:316)
    at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:365)
    at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:295)
    at sshjtest.TestSSH.main(TestSSH.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: net.schmizz.sshj.userauth.UserAuthException: class "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package
    at net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:33)
    at net.schmizz.sshj.userauth.UserAuthException$1.chain(UserAuthException.java:26)
    at net.schmizz.concurrent.Promise.deliverError(Promise.java:95)
    at net.schmizz.sshj.userauth.UserAuthImpl.notifyError(UserAuthImpl.java:151)
    at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:579)
    at net.schmizz.sshj.transport.Reader.run(Reader.java:79)
Caused by: net.schmizz.sshj.common.SSHException: class "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package
    at net.schmizz.sshj.common.SSHException$1.chain(SSHException.java:56)
    at net.schmizz.sshj.common.SSHException$1.chain(SSHException.java:49)
    at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:573)
    ... 1 more
Caused by: java.lang.SecurityException: class "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)

TL;DR: Is there a working binary package for SHHJ PLUS dependencies???

That would be HIGHLY appreciated.

Thanks a lot,
Stefan

Fabien Baligand

unread,
Oct 5, 2014, 5:02:49 PM10/5/14
to sshj-...@googlegroups.com
Hi,

I tested the same case than you ; and it works for me.
In my test, I have a single difference with you : I have not "bcprov-jdk15-140.jar" as a dependency.
So I invite you to test without this jar because I think this jar is in conflict with "bcprov-jdk15on-150.jar", and so, it is the problem.

Finally, to have a working log configuration, I invite you to add this jar : slf4j-jdk14-1.7.5.jar

Jeroen van Erp

unread,
Oct 6, 2014, 6:29:23 AM10/6/14
to sshj-...@googlegroups.com
Hi guys,

Let me ask you, what are you trying? If you use Maven, SSHJ itself should "just build" (TM). If you use maven/gradle/sbt or some other Java ecosystem build system for your project/product, all the dependency management is handled for you and there shouldn't be any problems.

Indeed some dependencies are set as "provided" so you don't need them. For inspiration you could for instance look at how overthere (https://github.com/xebialabs/overthere.git) depends on SSHJ in its build and adds the required dependencies. 

For the signer information stacktraces, it seems like you're running in a JVM where the security manager is enabled. You could/should ask the BouncyCastle guys about this one, because it seems to originate from their code and not the SSHJ code. See the message ( "org.bouncycastle.openssl.PEMReader"'s signer information does not match signer information of other classes in the same package).

Regards,
Jeroen

--
You received this message because you are subscribed to the Google Groups "sshj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sshj-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages