Page 1 of 1

OS X, Compliling Stunnel, fixing connectivity issues

Posted: Tue May 27, 2008 10:42 am
by hoplaa
Momentarily brushing aside the fact that some (like Zeus) hate people with macs (and I dont mean just the macs, actually the people who have them), I would require some help in ironing out the connectivity issues with the Shakespeer + Stunnel - solution.

So here's the deal, installed stunnel from source:

Code: Select all

 me$ stunnel -version 
stunnel 4.24 on i686-apple-darwin9.2.0 with OpenSSL 0.9.7l 28 Sep 2006
Threading:PTHREAD SSL:ENGINE Sockets:SELECT,IPv6 Auth:LIBWRAP
 
Global options
debug           = 5
pid             = /usr/local/var/run/stunnel/stunnel.pid
RNDbytes        = 64
RNDfile         = /dev/urandom
RNDoverwrite    = yes
 
Service-level options
cert            = /usr/local/etc/stunnel/stunnel.pem
ciphers         = ALL:!ADH:+RC4:@STRENGTH
key             = /usr/local/etc/stunnel/stunnel.pem
session         = 300 seconds
stack           = 65536 bytes
sslVersion      = SSLv3 for client, all for server
TIMEOUTbusy     = 300 seconds
TIMEOUTclose    = 60 seconds
TIMEOUTconnect  = 10 seconds
TIMEOUTidle     = 43200 seconds
verify          = none
OK,

the stunnel configuration file from twofo website is at :

Code: Select all

 /usr/local/etc/stunnel/stunnel.conf
And I have changed the port to something different. Now running

Code: Select all

 sudo stunnel3 
(for some reason its called stunnel3, instead of stunnel4) gives the following:

Code: Select all

2008.05.27 11:40:09 LOG7[11837:2684698528]: RAND_status claims sufficient entropy for the PRNG
2008.05.27 11:40:09 LOG7[11837:2684698528]: PRNG seeded successfully
2008.05.27 11:40:09 LOG7[11837:2684698528]: Certificate: /usr/local/etc/stunnel/stunnel.pem
2008.05.27 11:40:09 LOG7[11837:2684698528]: Certificate loaded
2008.05.27 11:40:09 LOG7[11837:2684698528]: Key file: /usr/local/etc/stunnel/stunnel.pem
2008.05.27 11:40:09 LOG7[11837:2684698528]: Private key loaded
2008.05.27 11:40:09 LOG7[11837:2684698528]: SSL context initialized for service stunnel
inetd mode must define a remote host or an executable

And running

Code: Select all

 sudo stunnel 
gives nothing in the terminal, and the following output in console (where there are logs)

Code: Select all

27/05/2008 11:31:39 stunnel[11810] LOG5[11810:2684698528]: stunnel 4.24 on i686-apple-darwin9.2.0 with OpenSSL 0.9.7l 28 Sep 2006 
27/05/2008 11:31:39 stunnel[11810] LOG5[11810:2684698528]: Threading:PTHREAD SSL:ENGINE Sockets:SELECT,IPv6 Auth:LIBWRAP 
27/05/2008 11:31:39 stunnel[11810] LOG5[11810:2684698528]: 125 clients allowed 
27/05/2008 11:31:39 stunnel[11810] LOG3[11810:2684698528]: Error binding wofo to 127.0.0.1:49812 
27/05/2008 11:31:39 stunnel[11810] LOG3[11810:2684698528]: bind: Address already in use (48) 
27/05/2008 11:31:39 stunnel[11815] warning: can't get client address: Bad file descriptor 
27/05/2008 11:31:39 stunnel[11814] warning: can't get client address: Bad file descriptor 
27/05/2008 11:31:39 stunnel[11813] warning: can't get client address: Bad file descriptor 
27/05/2008 11:31:39 stunnel[11812] warning: can't get client address: Bad file descriptor 
27/05/2008 11:31:39 stunnel[11811] warning: can't get client address: Bad file descriptor 
....


if I remove the [twofo] - line after Service-level configuration and run stunnel3, I get messages as above, but it tells me that inetd-mode doesnt accept connections. If I then comment the "accept"-line, it actually makes a connection, but obviously I then am not able to connect to localhost:8000 with Shakespeer/anything.

Any ideas ?

Posted: Tue May 27, 2008 11:10 am
by astropoint
What have you actually got in your stunnel.conf file as it is connecting there to something called 'wofo' rather than Twofo as it should be named in the file.

I know a fair number of people have gotten on via Shakespeer this year, however none of them ahve been able to get the thing searching/downloading in active mode for some reason (unrelated to stunnel). Just as a warning :)

Posted: Tue May 27, 2008 5:26 pm
by Zeus
I only hate Macs and Mac Fanboys, if you use a mac and shut up about it I wont mind (one of my best friends is a mac user)

Regardless, isn't it easier to use valknut? I know it's not the prettiest program but it has been working (besides the known filelist bug) so why try to use Shakespear?

its not about the looks

Posted: Tue May 27, 2008 6:42 pm
by hoplaa
Heya,

well, the reason really is that Valknut, in its compiled distribution, currently only exists for PPC. The nightly build is universal, and therefore somewhat snappier, but it's buggy.

And I was joking about your mac-hate. Everyone hates computer fanboys, be it on either side of the mac-pc divide.

So finding a way with Shakespeer would be nice. And it's also a great way to avoid studying for exams...

Also, I personally have had problems with the Valknut hash-list, so eg. Rampage can not download from me (he sees 0b shared out of 440Gb), which has grave consequences when getting kicked off the hub is concerned. I don't blame him for being mr. zeal, but hashing does seem to take forever on my machine, and I was hoping Shakespeer could prove a solution...

---

I'll get back once I do some more testing.

Posted: Tue May 27, 2008 7:38 pm
by Zeus
Well, if prior warning is given I'm sure a 24 hour grace period can be granted.

Posted: Tue May 27, 2008 8:14 pm
by Rampage
Macs are crap indeed. Mac users don't really *use* the machine so fail

And regarding stunnel if you are running stunnel3 you need the following to set it up.

Code: Select all

sudo stunnel3 -c -d 8000 -r hub.twofo.co.uk:4146
or

Code: Select all

sudo stunnel -c -d 8000 -r hub.twofo.co.uk:4146
Stunnel4 uses the config file avaibable but stunnel 3 doesn't. Use the following to run stunnel4

Code: Select all

sudo stunnel4
Hope that helps


EDIT: Umm, if the stunnel4 doesn't work try the stunnel3 code not sure which one will work. Also run a this and check how many stunnel conf files there are please.

Code: Select all

locate stunnel.conf

Posted: Wed May 28, 2008 6:10 pm
by xyzzy
Excuse me, but what known filelist bug?

Anyway, a new version of valknut is about to be released, including a fix for your sharesize being reported as 0 (for a very short time, not during all hashing).

I know uploads cannot be started during refresh, but your filelist can still be accessed. I will look into improving that situation.

Posted: Wed May 28, 2008 6:35 pm
by Zeus
well that bug specifically, there's no better term for it since it shouldn't give a share without having hashed it. It's how the other DC clients work.

---see other post

Posted: Thu May 29, 2008 2:04 am
by hoplaa
Well,

none of those above commands worked. Cant even remember the output. Here's the link to a new post (make sticky maybe?), which explains how we can just rely on GUI to get things working (...well...apart from compiling Stunnel) !

--> Quick tutorial for Shakespeer + active mode + stunnel :

viewtopic.php?p=4669#4669

-->