1

I have checked the many other threads here on this error but they all seem nuch more complicated than my very simple situation.

I have a TIdHTTP component (ver 10.2.5) on a form in Delphi 2009 connected to a TIdSSLIOHandlerSocketOpenSSL. All parameters have been left at their default.

I get the text of a web page using the single line

MyString := IdHTTP1.Get(searchURL);

At home on a Win 7 machine this line works fine but if I copy my program to a server at work (running server 2013) that line generates the error

EIdSocketError 10061 Connection refused.

Other posts mention checking the port etc but there is no port property in TidHTTP.

Is this error at work likely to be caused by the firewall or antivrus program at work preventing my program getting on the Internet, or is there something special I need to do in my program?

(Putting the same url into Internet Explorer at work shows the expected page ok)

For info the default parameters of the TIdHTTP and TIdSSLIOHandlerSocketOpenSSL components are as follows:

object IdHTTP1: TIdHTTP
    IOHandler = IdSSLIOHandlerSocketOpenSSL1
    AllowCookies = True
    ProxyParams.BasicAuthentication = False
    ProxyParams.ProxyPort = 0
    Request.ContentLength = -1
    Request.Accept = 'text/html, */*'
    Request.BasicAuthentication = False
    Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
    HTTPOptions = [hoForceEncodeParams]
  end

  object IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL
    MaxLineAction = maException
    Port = 0
    DefaultPort = 0
    SSLOptions.Mode = sslmUnassigned
    SSLOptions.VerifyMode = []
    SSLOptions.VerifyDepth = 0
  end

all the properties of the TidHTTP are enter image description here

user3209752
  • 619
  • 2
  • 17
  • 29
  • *" but there is no port property in TidHTTP."* - There should be. – GolezTrol Nov 06 '15 at 10:46
  • No there isn't. See my own 'answer' for a screenshot of the properties – user3209752 Nov 06 '15 at 11:03
  • Did you also copy the OpenSSL DDLs to the 2013 server? – mjn Nov 06 '15 at 11:38
  • Check the firewall on the server... – whosrdaddy Nov 06 '15 at 12:19
  • @mjn No I didn't - but that line doesn't use SSL. Do they have to be there anyway? – user3209752 Nov 06 '15 at 14:04
  • @whosrdaddy Do you think that could be the cause? That's my suspicion as its is locked down pretty firmly but I wanted to get the opion of people who are much more expert in this area than me as to whether to ask the technician to start investigating firewall and AV rules. – user3209752 Nov 06 '15 at 14:06
  • @mjn I copied ssleay32.dll and libeay32.dll to the application folder on the server but it made no difference, still got error 10061 connection refused – user3209752 Nov 06 '15 at 14:52
  • Did you check the proxy settings of the 2013 server? – mjn Nov 06 '15 at 14:56
  • TIdSSLIOHandlerSocketOpenSSL made me think that `searchURL` could be a HTTPS address – mjn Nov 06 '15 at 14:56
  • Ah, yes it is, sorry I had forgotten. the address is https://api.vivomiles.com/Enterprise.doLogin?api_key=xxxxxxxx&response_format=json& (not my real key so going there will give you an invalid key error) and it simply logs onto that site and returns a sessionID. But I now have ssleay32.dll and libeay32.dll in the application folder and I still get the error. How do I check the proxy settings on the server? (and what am I looking for?) Do I need to make some changes to the Indy component? – user3209752 Nov 06 '15 at 15:20
  • Do you know if you have direct internet access on that server? You can test with a normal browser and check the proxy settings within the browser? – whosrdaddy Nov 06 '15 at 15:34
  • I don't really know what you mean by checking the proxy settings but if I use the Internet explorer on that server to go to that url it works fine – user3209752 Nov 06 '15 at 18:13
  • Thanks to all who contributed (except the downvoter ). I have now rather given up on trying to get Indy to do the job. Instead I have converted all the code to use the WinINet API using code from here: http://stackoverflow.com/questions/301546/whats-the-simplest-way-to-call-http-get-url-using-delphi That works flawlessly for what I need, calling an api on a web page and getting back a string of data. – user3209752 Nov 06 '15 at 19:53
  • 2
    Wel if wininet works, the culprit is most likely a proxy server. for internet explorer/wininet proxy server is set via [internet options - connections tab - lan settings](http://windows.microsoft.com/en-us/windows/change-internet-explorer-proxy-server-settings#1TC=windows-7). With Indy you need to specify the proxy server on the component... – whosrdaddy Nov 06 '15 at 22:39

0 Answers0