Steve, Thanks for taking the time to answer my mail. I have found the problem. I traced through the OpenSSL source adding debug statements as I went along. I found that the code was dying on a call to readsocket (which as you know is just recv for Windows) Basically, the call trace went like this.. ssl2_read -> read_n -> BIO_read -> sock_read -> readsock . The reason it was dying is that the socket was timing out. I felt pretty stupid when I made a call to WSAGetLastError() and printed the debug message out (10060). I found that the function was just returing -1 and then passing that all the way back through the chain. Glad this is resolved, but it would seem like we should set this error code down below so that we have a clue what went wrong. Thanks. -Jim Dr Stephen Henson wrote: > Jim Miller wrote: > > > > Dr. Henson, > > I hate to send you a question directly, but I have not yet received > > a response from the list adminstrator regarding my acceptance to the > > openssl-dev list. Nonetheless, I have stumbled upon a problem that I > > have been beeting myself silly with the last week or so. I have been > > having problems connecting to a web server using OpenSSL. Essentially, > > I took the cli.cpp example and built it for Windows. I then added a > > SSL_write which posts a message to the server and an SSL_read that reads > > the returned information. My problem is that more often than not the > > first time I run this program after boot my NT box it fails. It also > > fails if I run it in the debugger (Visual C++ on NT 4.0) and rebuild > > it. I know this is really vague, but if you have a moment I would > > really appreciate any insight you may have. I have attached the code. > > > > Can you narrow the problem down further? For example what is failing and > does it produce any error messages? > > You will need to recompile OpenSSL if you need to use the debugger: by > default OpenSSL don't include the debugging options and it may well > crash or exhibit weird behaviour because the runtime libraries are being > mixed. > > Steve. > -- > Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/ > Personal Email: [EMAIL PROTECTED] > Senior crypto engineer, Celo Communications: http://www.celocom.com/ > Core developer of the OpenSSL project: http://www.openssl.org/ > Business Email: [EMAIL PROTECTED] PGP key: via homepage.
begin:vcard n:Miller;Jim tel;cell:703-629-3236 tel;fax:703-421-2592 tel;work:703-421-1755 x-mozilla-html:TRUE url:www.entegrity.com org:Entegrity Solutions;Professional Services adr:;;2077 Gateway Place, Ste. 200;San Jose;CA;95110;US version:2.1 email;internet:[EMAIL PROTECTED] title:Security Architecture & Integration Team fn:Jim Miller end:vcard
