[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: socket descriptor specified w/i gsk_handle not valid



Hi Kim,

> When I call the program to do this, I get the following error:
> SetError() #7: Timeout occurred while trying to connect to server!

This means that HTTPAPI is trying to connect to the server, but isn't 
getting a response.  Obviously, you don't want it to sit and wait 
forever...   after a certain amount of time (60 seconds by default) it 
gives up on waiting for the response, and says "timeout while trying to 
connect".

I like to use a telephone call as an analogy.  Remember in the days 
before everyone had answering machines?  You'd call a telephone number 
and you'd get no answer.  It'd just ring and ring and ring.  How long do 
you wait for someone to pick up?  5 rings?  10 rings?  an hour? 
Eventually you decide nobody is going to answer, so you give up.

Why is the connection failing?  That's a much more difficult question to 
answer, because I don't have any information.  All I know is that the 
connection request was sent, and no reply was received.

It could be that someone took a scissors and cut your network cable! 
Possible, but unlikely -- if your network cable was cut, you'd probably 
notice.  There are a multitude of possibilities...  but most of them are 
like the "cable is cut" situation, they'd affect other things, so you'd 
have already noticed.

The exception is a firewall.  A firewall can cause this exact error 
without affecting other things.  A firewall can be configured to block 
HTTP requests from this one particular computer, without affecting 
anything else.  In fact, it's relatively common.  "After all, they'll 
never run a web browser on the AS/400!"

Also, firewalls don't usually report errors, they just drop the packets. 
  For example, if you connect directly to a computer (no firewall in 
between) and try to connect to a system with no HTTP server...  the 
connection will immediately fail with a "Connection Refused" error. 
Why?  Because the computer will send back an error message ("connection 
refused") to HTTPAPI...    A firewall, however, doesn't respond at all, 
it just discards your connection attempt, and leaves you hanging.   So 
the program just sits and waits until it times out.

> In going through the FTPAPI archives, I see one other post where someone
> had this problem, and Scott thought that either the server was down, or
> there is a firewall blocking access to the server. However, the person
> who had the question didn't say if that was the case.

Heh... I've had this question dozens if not hundreds of times.  It's 
almost always a firewall issue.  Occasionally it's something like "my 
ISP just happened to be down when I tried"  or "it's a new router, only 
used for this, and it's broken".  But, 99% of the time, it's a firewall.

> I've contacted the help desk for the service I'm trying to POST to, and
> they think it's a certificate installation error. But in looking at the
> above debug file, it looks as if we've got the certificate information
> and are presenting it when trying to make the SSL connection.

Back to the telephone analogy...   blaming the problem on certificates 
is like saying "I was hungry, so I tried to order a pizza.  They didn't 
answer the phone.  I never received my pizza, do you think I gave them 
the wrong address?"

Obviously you couldn't have given them the wrong address, since you 
never actually TALKED to anyone -- they didn't answer the phone!

The same is true with your connection timing out.  You haven't actually 
connected to the server, so no certificates have been exchanged.  You 
couldn't possibly have a certificate error!  You might have one later, 
once you get past the first hurdle, though...

Oh well...  hope this helps.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------