title: Log in twice via Idhttp
body: <p>I have placed an Idhttp component on my main form and an IdSSLIOHandlerSocketOpenSSL and both components are not adjusted via the IDE. I use it to access two servers:</p>
  
  <p>1) A http server which requires an authentication; </p>
  
  <p>2) A https-server (which requires an authentication). </p>
  
  <p>When I connect via Idhttp to server (1) I can connect via a regular fashion. However, when I connect to server (2) it returns a message that the user credentials are not correct. </p>
  
  <p>I tried switching the procedures but then I cannot login into server (1): I get in both situations the response from the server that I input wrong credentials.</p>
  
  <p>I presume some property is changed. I checked the Idhttp.Request.UserName and  Idhttp.Request.Password before I connect and they are correct.</p>
  
  <p>What is going wrong?</p>
  
  <pre><code>procedure TForm1.AccessServer1;
  var  
    fs: TMemoryStream
  begin  
    fs := TMemoryStream.Create;
    IdHTTP1.Request.BasicAuthentication := true;
    IdHTTP1.Request.UserName := myUsername1;
    IdHTTP1.Request.Password := MyPassword1;
    try
      IdHTTP1.Get(myURL1, fs);
      fs.SaveToFile(MyFilename);
    finally
      fs.free
    end;
  end;
  
  procedure TForm1.AccessServer2;
  var  
    fs: TMemoryStream
  begin  
    fs := TMemoryStream.Create;
    IdHTTP1.Request.BasicAuthentication := true;
    IdHTTP1.Request.UserName := myUsername2;
    IdHTTP1.Request.Password := MyPassword2;
    IdHTTP1.HandleRedirects := True;
    IdHTTP1.IOHandler := AIdSSLIOHandlerSocketOpenSSL;
    try
      IdHTTP1.Get(myURL2, fs);
      fs.SaveToFile(MyFilename);
    finally
      fs.free
    end;
  end;
  </code></pre>