These are chat archives for IndySockets/Indy

Jun 2017
Jun 06 2017 04:15
I see what you mean (from MembershipSockOpt)
Jun 06 2017 04:32
Some information here:
I'm still digesting it...
Looks like the interface number does matter
Jun 06 2017 11:06
...or not? seems to be conflicting info on the 'net..
Jun 06 2017 11:38

I have still problems with HTTP and NTLM Proxy :( IdAuthenticationNTLM, IdAuthenticationSSPI, IdAuthenticationDigest are used in the interface uses section
For debugging I created event handler for every event of TIdHTTP with logging all method parameters.
First OnStatus (with hsConnecting) will be fired, then OnStatus again (with hsConnected), OnHeadersAvailable, OnWorkBegin (AWorkCountMax = 2609), OnWork (AWorkCount = 2609) and OnWorkEnd as last... No OnProxyAuthorization or OnSelectProxyAuthorization is called!
The received header is

Proxy-Authenticate: Negotiate
Proxy-Authenticate: NTLM
Date: Tue, 06 Jun 2017 09:07:12 GMT
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset="UTF-8"
Content-Length: 2609
Accept-Ranges: none
Proxy-Connection: keep-alive

The component will be created via

  LHttp := TIdHTTP.Create(nil);
  LHttp.ProxyParams.ProxyServer := LProxy.ProxyServer;
  LHttp.ProxyParams.ProxyPort := LProxy.ProxyPort;
  if LProxy.UseAuthentification then
    LHttp.ProxyParams.BasicAuthentication := True;
    LHttp.ProxyParams.ProxyUsername := LProxy.Username;
    LHttp.ProxyParams.ProxyPassword := LProxy.Password;
  LHttp.Request.UserAgent := 'My Client ' + CVersion; // WebServer will always accept this user agent
  LHttp.OnAuthorization := HTTP1Authorization;
  LHttp.OnChunkReceived := HTTP1ChunkReceived;
  LHttp.OnConnected := HTTPConnected;
  LHttp.OnDisconnected := HTTPDisconnected;
  LHttp.OnHeadersAvailable := HTTP1HeadersAvailable;
  LHttp.OnProxyAuthorization := HTTP1ProxyAuthorization;
  LHttp.OnRedirect := HTTP1Redirect;
  LHttp.OnSelectAuthorization := HTTP1SelectAuthorization;
  LHttp.OnSelectProxyAuthorization := HTTP1SelectProxyAuthorization;
  LHttp.OnStatus := HTTP1Status;
  LHttp.OnWork := HTTP1Work;
  LHttp.OnWorkBegin := HTTP1WorkBegin;
  LHttp.OnWorkEnd := HTTP1WorkEnd;

  LHttp.Get(LUrl, LFileStream, [CAccepted_WebServerResponses]);

Did I miss something?
I also have Wireshark logs of the Get-Trys. The first Get from Indy sends already a Proxy-Authorization in Basic, is that correct? But Answer is always HTTP/1.1 407 Proxy Authorization required and there is no more traffic, no second attampt is maded. My biggest problem is, I have no test enviremont. Every change I do, I have to create a new binary and give it to a customer (which knows that they are experimental and, for now, is happy to be a alpha tester).

Jun 06 2017 11:47
which version of Indy?
Jun 06 2017 11:48
The one shipped with Delphi Berlin
Jun 06 2017 11:50
are you unable to debug this yourself? if the result is 407, the OnSelectProxyAuthorization event should be called, unless MaxAuthRetries is exceeded.. what do you have that set to?
actually, equal to, or exceeded
Jun 06 2017 11:52
Nop, I have no proxy which requires NTLM authentication, so I cant debug, only building binaries and give it to my customer :(
MaxAuthRetries is unchanged, so it should still be on 3 (as Indy default)
I also tried to send a second GET after the first failed one with MauxAuthRetries = 42. No success :(
(Only a lot of more traffic in the wireshark log, but all the same as the first try: Indy only sends a GET with basic authentication and proxy answers with 407)