Hi,
I'm running stunnel 4.04 on ia64-redhat-linux-gnu PTHREAD+LIBWRAP with OpenSSL 0.9.7a Feb 19 2003.
I have basically taken a generic TCP interface and implemented a STUNNEL client/server setup to allow the connection to transfer data using SSL. I have an issue with checking the status of the connection when a connection attempt is made. We are using ObjectSpace libraries for all of our tcp related connections so I don't have the low level calls that are actually being made, but here is a brief description of what is happenning....
We create an os_tcp_socket object and call the connect_to() method. This establishes a connection to the stunnel client on my local machine....which in turn makes the connection the the stunnel server on the remote machine. The problem I'm am having is when I can't get to the remote machine. After the connect_to() call, we check the status of the socket and unless I sleep for 5-10 seconds, it always seems to think that the connection is ok...which kind-of makes sense because it is able to connect to the stunnel client port since it is local...but in fact, if there isn't access to the remote machine, eventually stunnel will close that initial connection to that socket (that where the 5-10 second delay seems to help). The status I really want is weather or not the entire connection was successful through stunnel to the remote machine. Is there a better way to do this other than putting a sleep() in. Right now I have a 10 second sleep in between the connect_to() call and the status check on the local/client stunnel TCP port. That seems to be enough time for stunnel to attept to complete the connection and kill the connection to it's local/client port so that when I check the status of it, it comes back bad.
If this is the best way to do it...what is the amount of time needed for stunnel to attempt to complete it's connection to the remote machine?
Thanks!
Jeff
Jeffrey Buck Jeffrey.Buck@raytheon.com wrote:
I'm running stunnel 4.04 on ia64-redhat-linux-gnu PTHREAD+LIBWRAP with OpenSSL 0.9.7a Feb 19 2003.
You're so brave! 8-)
Mike
Ok, I've installed stunnel 4.22 and I still run into the same problem. I do see a new option called "TIMEOUTconnect" but I'm not sure it is going to help me in this case. Although, maybe the answer is that I need to sleep longer than this TIMEOUTconnect value before checking the status of the local socket connection????
Jeff
Michal Trojnara Michal.Trojnara@mobi-com.net Sent by: stunnel-users-bounces@mirt.net 08/07/2008 11:25 AM
To stunnel-users@mirt.net cc
Subject Re: [stunnel-users] Socket connection status
Jeffrey Buck Jeffrey.Buck@raytheon.com wrote:
I'm running stunnel 4.04 on ia64-redhat-linux-gnu PTHREAD+LIBWRAP with OpenSSL 0.9.7a Feb 19 2003.
You're so brave! 8-)
Mike
_______________________________________________ stunnel-users mailing list stunnel-users@mirt.net http://stunnel.mirt.net/mailman/listinfo/stunnel-users
Jeffrey Buck wrote:
Ok, I've installed stunnel 4.22 and I still run into the same problem. I do see a new option called "TIMEOUTconnect" but I'm not sure it is going to help me in this case. Although, maybe the answer is that I need to sleep longer than this TIMEOUTconnect value before checking the status of the local socket connection????
I think it's a great solution to make sure if the remote host is up and accepting connections. Waiting one second more than "TIMEOUTconnect" setting will work just fine.
Best regards, Mike