Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Delphi INDY + SSL + Socks

There is a problem:

When using a Socks4 proxy is not running HTTPS, the redirect goes to HTTP.

var
  https: TIdHTTP;
  ssl: TIdSSLIOHandlerSocketOpenSSL;
  sock: TIdSocksInfo;
begin
  https:=TIdHTTP.Create(nil);
  ssl := TIdSSLIOHandlerSocketOpenSSL.Create(https);
  ssl.SSLOptions.CipherList := 'ALL';
  ssl.PassThrough := False;
  sock := TIdSocksInfo.Create;
  sock.authentication := sanoauthentication;
  sock.version := svSocks4;
  sock.host := '201.222.29.86';
  sock.port := 4145;
  ssl.transparentproxy := sock;
  https.IOHandler := ssl;
  https.HandleRedirects:=true;
  try
    https.get('https://www.facebook.com/');
  except

  end;
  FreeAndNil(sock);
  FreeAndNil(ssl);
  FreeAndNil(ssl);

image

If I remove the socks4, then all is well:

image

Comments