Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8085675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:12:11+00:00 2026-06-05T18:12:11+00:00

So this used to work without a hitch but now I get a Socket

  • 0

So this used to work without a hitch but now I get a “Socket Error #10054 Connection reset by peer.”

I assume it started happening once I updated my Indy packages. Today was my first time running the code since then.

Can anyone explain how the update might have changed the behavior of this code And how to resolve it?

Thank You

function PostData(url : string; param: TStringList) : string;
var
  text: string;
  sHttpSocket: TIdHTTP;
  sshSocketHandler: TIdSSLIOHandlerSocketOpenSSL;
  resStream: TStringStream;
begin
  sHttpSocket := TIdHTTP.create;
  sshSocketHandler := TIdSSLIOHandlerSocketOpenSSL.create;
  sHttpSocket.IOHandler := sshSocketHandler;
  sHttpSocket.Request.ContentType := 'application/x-www-form-urlencoded';
  sHttpSocket.Request.Method := 'POST';
  resStream := TStringStream.create; 
  sHttpSocket.Post(url, param, resStream);
  resStream.Seek(0, soFromBeginning);
  text := resStream.DataString;
  result := text;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:12:13+00:00Added an answer on June 5, 2026 at 6:12 pm

    If you are posting to an HTTPS url, make sure the TIdSSLIOHandlerSocketOpenSSL is configured properly for the server you are trying to connect to. Chances are, the defaults might not be matching up with what the server is actually expecting. In particular, the TIdSSLIOHandlerSocketOpenSSL.Method and TIdSSLIOHandlerSocketOpenSSL.SSLVersions properties default to TLSv1, but maybe the server does not support TLSv1.

    On a side note, TStringStream operates differently in D2009+ than it did in earlier versions, so I would suggest you avoid it and let Indy decode the Text for you:

    function PostData(const url : string; params: TStrings) : string; 
    var 
      sHttpSocket: TIdHTTP; 
      sshSocketHandler: TIdSSLIOHandlerSocketOpenSSL; 
    begin 
      sHttpSocket := TIdHTTP.Create; 
      try
        sshSocketHandler := TIdSSLIOHandlerSocketOpenSSL.Create(sHttpSocket); 
        // configure sshSocketHandler as needed...
        // perhaps try this at a minimum:
        // sshSocketHandler.SSLOptions.Method := sslvSSLv23;
        sHttpSocket.IOHandler := sshSocketHandler; 
        Result := sHttpSocket.Post(url, params); 
      finally
        sHttpSocket.Free;
      end;
    end; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This JPQL used to work but then it broke for no reason. I now
This used to work alright. Now I am getting this error: rake/rdoctask is deprecated.
I swear this used to work, but it's not in this case. I'm trying
I do not get the last version of node-http-proxy working (this used to work
This code used to work but doesnt any more. i used a breakpoint, and
This piece of code used to work in MVC 1 but it does not
this code in my plugin used to work just fine: jQuery('#embedded_obj', context).get(0).getVersion(); and the
This code used to work. Then, maybe I changed something, somewhere (or if I
...at least to me. This code used to work fine. I'm pretty sure nothing
My question centers on some Parallel.ForEach code that used to work without fail, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.