Page 1 of 1

how to do http post with tschttpwebrequest with tsl 1.2

Posted: Tue 27 Aug 2019 01:21
by fuandi
I’m using devart securebridge tschttpwebrequest to do a http post to a server with tsl 1.2.
I got this error EScError with message 'Socket closed. Cannot receive data'

I set the property tsl1.2 to true.
Below is my snippet code, any mistake or something I missed ?

ScHttpWebRequest1.RequestUri:='https://blablabla';
ScHttpWebRequest1.Method:= rmPost;
ScHttpWebRequest1.Accept:='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
ScHttpWebRequest1.ContentType := 'application/json';


Buf := TEncoding.UTF8.GetBytes(jsonResult.ToString);
ScHttpWebRequest1.ContentLength := Length(Buf);
ScHttpWebRequest1.WriteBuffer(Buf);

httpwebresponse := ScHttpWebRequest1.getresponse;

Re: how to do http post with tschttpwebrequest with tsl 1.2

Posted: Tue 03 Sep 2019 12:53
by ViktorV
For us to quickly investigate this behavior of SecureBridge, please allow test access to your server and send it to us using the contact form https://www.devart.com/company/contactform.html.

Re: how to do http post with tschttpwebrequest with tsl 1.2

Posted: Wed 04 Sep 2019 01:37
by fuandi
Hi viktor,

Thanks for your reply.

I already write in contact form and already reply your email that the server is not for public access.
My question is, is my code above missing something ? or do you have any example on how to do http post to with tsl1.2 ?
Can you write here on how to do this the proper way ?

Re: how to do http post with tschttpwebrequest with tsl 1.2

Posted: Wed 04 Sep 2019 13:18
by ViktorV
We haven't received any emails from you saying that you are not able to provide us with test access to the server. Your code runs correctly, therefore, we asked for test access to your server to identify the cause of the issue.