[org.silvertunnel_ng.netlib.layer.tor.clientimpl.TorBackgroundMgmtThread] DEBUG org.silvertunnel_ng.netlib.layer.tor.clientimpl.TorBackgroundMgmtThread - Not yet spawning circuits (too few routers known until now)
then, at some point I get a socket time out exception, but it still continues to loop.
Could you tell me why its doing that?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this can only happen during the phase of getting the compressed directory information.
Either the protocol has changed or the directory server you are trying to reach is using a different way of compression.
The library currently isnt that stable to get around a not existing directory ;)
I hope I will find some time to fix this but as I will soon start my honeymoon it wouldnt be before November.
regards Tobi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Congratulations on your (forthcoming?) marriage then! :)
Well, I set "httptest.silvertunnel-ng.org" + "/checktor.php" as the test-url, which should use the same compression, shouldn't it? ;)
If it takes that long, I might try to fix it myself and send the solution your way if I find one.
I have another question: The "example" code in TorHiddenServiceServerRemoteTest.java seems a bit overloaded, which is the simplest way to get a Hidden Service running (and possibly get a .onion domain name for it)?
What I'm trying to do is establishing a socket connection via Tor between two Java applications. Therefore, I need to have a hidden service running behind a .onion domain so I can connect to it with one or more clients...
Is that even possible with this library / is that the right way to go? Silvertunnel-NG is the most advanced library I found for Java. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With getting the compressed directory I meant the following:
When the Tor-Library tries to connect to an given address (in this case httptest.silvertunnel-ng.org) it first needs to create a Circuit to this address.
A Circuit usually contains an Entry-Point, a middle-Point and an exit-Point. For determining which Tor-Relay to use as one of these points it needs a so called Directory and therefor it has to first connect to a Tor-Relay which also contains the Directory of other Tor-Relays and to make this more efficient the Tornetwork also uses compression when transferring these Directories.
I've tested the library yesterday and could connect without problems. (Using JDK 7)
So maybe there is an issue with your Java Runtime.
Which Version of Java are you using?
Which OS?
regards Tobi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding the question if a socket connection is possible : yes ;)
The TorHiddenServiceServerRemoteTest seems to be overloaded because it is setting up the HiddenService inside the Tor Network and is also providing a simple http server for testing purposes.
So you could just grab this Test and modify it to your needs.
Currently I'm not 100% sure if I have already made sure that the onion address is saved somehow o.o (was really busy at work lately)
regards Tobi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
java.util.zip.ZipException: incorrect header check
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at org.silvertunnel_ng.netlib.tool.SimpleHttpClientCompressed.get(SimpleHttpClientCompressed.java:150)
at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.updateDirectoryConsensus(Directory.java:437)
at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.updateNetworkStatusNew(Directory.java:577)
at org.silvertunnel_ng.netlib.layer.tor.directory.Directory.refreshListOfServers(Directory.java:328)
at org.silvertunnel_ng.netlib.layer.tor.directory.DirectoryManagerThread.updateDirectory(DirectoryManagerThread.java:67)
at org.silvertunnel_ng.netlib.layer.tor.directory.DirectoryManagerThread.run(DirectoryManagerThread.java:80)
I don't need any Tor installation on my system, do I?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Whilst waiting for you to respond, I tried to set up a hidden service with this code (mostly taken from the silvertunnel website):
TorNetLayerUtil torNetLayerUtil = TorNetLayerUtil.getInstance();
TorHiddenServicePrivateNetAddress newNetAddress = torNetLayerUtil.createNewTorHiddenServicePrivateNetAddress();
//Look, I even found a way to get the hidden service address! :D
System.out.println(newNetAddress.getPublicOnionHostname());
File directory = new File("/");
directory.mkdir();
torNetLayerUtil.writeTorHiddenServicePrivateNetAddressToFiles(directory, newNetAddress);
TorHiddenServicePrivateNetAddress netAddress = torNetLayerUtil.readTorHiddenServicePrivateNetAddressFromFiles(directory, true);
TorHiddenServicePortPrivateNetAddress netAddressWithPort =
new TorHiddenServicePortPrivateNetAddress(netAddress, port);
NetLayer netLayer = NetFactory.getInstance().getNetLayerById(NetLayerIDs.TOR);
netLayer.waitUntilReady();
serverSocket = (TorNetServerSocket)netLayer.createNetServerSocket(null, netAddressWithPort);
I guess it should work, as it looks very similar to your code in the test. But I encountered another error when trying to run it:
no you dont need a Tor installation, as this library is implementing everything which is needed to communicate to the Tor network.
This NoClassDefFoundError on bouncycastle means that you are missing some dependencies.
Are you using maven with your project?
If not you have to provide all the dependencies on your own.
Could you maybe attach a full log of your test?
regards,
Tobi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't use Maven, but already had added bcprov-jdk16-140.jar (as well as all other dependencies you listed in the wiki) to my projects Build Path when I got that error.. :(
I uploaded the logs with the corresponding code snippets.
The Tor-Server is answering with uncompressed data, this was not yet happening in my tests (as I'm requesting compressed data inside the library) so I didnt took this into account.
I will fix this error and provide a new snapshot.
Sometimes a full log helps ;)
regards Tobi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I still have the "NoClassDefFoundError: org/bouncycastle/asn1/ASN1Primitive" when trying to use TorNetLayerUtil.createNewTorHiddenServicePrivateNetAddress().
I looked into the jar you linked in the wiki and there is no such file in it.. I found it in another Version of Bouncycastle, but that one did not provide openssl-functioning (was missing PEMWriter then). Then I tried to merge them, but it didn't work.
Do you have any idea how to solve this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
when I run the Demo (after adding log4j to the classpath, which you didn't mention ;)), I get this error:
after that, it seems to loop between:
and
then, at some point I get a socket time out exception, but it still continues to loop.
Could you tell me why its doing that?
Hi,
this can only happen during the phase of getting the compressed directory information.
Either the protocol has changed or the directory server you are trying to reach is using a different way of compression.
The library currently isnt that stable to get around a not existing directory ;)
I hope I will find some time to fix this but as I will soon start my honeymoon it wouldnt be before November.
regards Tobi
Congratulations on your (forthcoming?) marriage then! :)
Well, I set "httptest.silvertunnel-ng.org" + "/checktor.php" as the test-url, which should use the same compression, shouldn't it? ;)
If it takes that long, I might try to fix it myself and send the solution your way if I find one.
I have another question: The "example" code in TorHiddenServiceServerRemoteTest.java seems a bit overloaded, which is the simplest way to get a Hidden Service running (and possibly get a .onion domain name for it)?
What I'm trying to do is establishing a socket connection via Tor between two Java applications. Therefore, I need to have a hidden service running behind a .onion domain so I can connect to it with one or more clients...
Is that even possible with this library / is that the right way to go? Silvertunnel-NG is the most advanced library I found for Java. :)
Thank you ;)
With getting the compressed directory I meant the following:
When the Tor-Library tries to connect to an given address (in this case httptest.silvertunnel-ng.org) it first needs to create a Circuit to this address.
A Circuit usually contains an Entry-Point, a middle-Point and an exit-Point. For determining which Tor-Relay to use as one of these points it needs a so called Directory and therefor it has to first connect to a Tor-Relay which also contains the Directory of other Tor-Relays and to make this more efficient the Tornetwork also uses compression when transferring these Directories.
I've tested the library yesterday and could connect without problems. (Using JDK 7)
So maybe there is an issue with your Java Runtime.
Which Version of Java are you using?
Which OS?
regards Tobi
Regarding the question if a socket connection is possible : yes ;)
The TorHiddenServiceServerRemoteTest seems to be overloaded because it is setting up the HiddenService inside the Tor Network and is also providing a simple http server for testing purposes.
So you could just grab this Test and modify it to your needs.
Currently I'm not 100% sure if I have already made sure that the onion address is saved somehow o.o (was really busy at work lately)
regards Tobi
I think I'm using jdk8 as I just reinstalled my PC (Windows 8.1), but cannot be 100% sure until I get home from work in about 2 hours...
Thank you for the explanation, I'm not that familiar with Tor yet and still figuring out how it works :)
I will post an update in here as soon as I can!
Okay, still got the error when using jre7.
The stack trace is:
I don't need any Tor installation on my system, do I?
Whilst waiting for you to respond, I tried to set up a hidden service with this code (mostly taken from the silvertunnel website):
I guess it should work, as it looks very similar to your code in the test. But I encountered another error when trying to run it:
gives me a
in jre7 and 8. But I think I'm on the right way, am I?
I also tried to play around a bit with the demo code to use sockets only (to connect to my server) but it still hangs at the same point. :(
Hi,
no you dont need a Tor installation, as this library is implementing everything which is needed to communicate to the Tor network.
This NoClassDefFoundError on bouncycastle means that you are missing some dependencies.
Are you using maven with your project?
If not you have to provide all the dependencies on your own.
Could you maybe attach a full log of your test?
regards,
Tobi
I don't use Maven, but already had added bcprov-jdk16-140.jar (as well as all other dependencies you listed in the wiki) to my projects Build Path when I got that error.. :(
I uploaded the logs with the corresponding code snippets.
Last edit: blkchockr 2014-09-19
I've found the error!
The Tor-Server is answering with uncompressed data, this was not yet happening in my tests (as I'm requesting compressed data inside the library) so I didnt took this into account.
I will fix this error and provide a new snapshot.
Sometimes a full log helps ;)
regards Tobi
Nice, glad to hear that and being able to help tracking down the issue. :)
Thank you for your time, effort and this great library of course!
Edit: Oh wait, what about my server-side-code? Did you test it? I couldn't get it to work yet. Or is it having the same problem?
Last edit: blkchockr 2014-09-22
Its having the same problem.
When SourceForge is done uploading the zipped-snapshot you can download the fixed library.
It should work better now ;)
I still have the "NoClassDefFoundError: org/bouncycastle/asn1/ASN1Primitive" when trying to use TorNetLayerUtil.createNewTorHiddenServicePrivateNetAddress().
I looked into the jar you linked in the wiki and there is no such file in it.. I found it in another Version of Bouncycastle, but that one did not provide openssl-functioning (was missing PEMWriter then). Then I tried to merge them, but it didn't work.
Do you have any idea how to solve this?
The bouncycastle version used is 1.50
You can get them here :
bcprov-jdk15on-1.50.jar
bcpkix-jdk15on-1.50.jar
To check the most recent used dependencies you can also have a look at the pom-file of the project.
I feel so dumb right now, I just didn't think of adding them both. Instead I tried to merge the jars.
Well anyway, I got my Socket connection working now, so thank you very much again! :D
Youre welcome :)
Glad to hear that it is working now.