A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi UniqueName_B,
As per your description, it seems you connect to SharePoint online using Apache HTTP and you get connection reset error message.
As our forum focus on how to deal with the out-of-box issue of SharePoint and as we don't have enough resource in our forum community and we are really sorry for couldn't provide a better suggestion for you. For using SharePoint HTTP/ REST APIs, we sincerely recommend you raise questions in Microsoft Q&A – SharePoint Online. Questions about programming, development, and so on can all get answered there. Experts there forum would conduct in-depth research on the problem you encountered and provide you with more professional assistance.
For reference: Connect to SharePoint using the SPHttpClient
I appreciate your understanding and stay safe!!
Best Regards
Waqas Muhammad