Download MetaTrader 5

WebRequest returns -1 with error 5203 for HTTPS POST

To add comments, please log in or register
alaeddin
14
alaeddin  

Hi,

I'm posting a https request in my EA but the WebRequest returns -1 with error 5203 ERR_WEBREQUEST_REQUEST_FAILED. What do you think the problem is?

 

Thanks,

 Ala 

JC
1592
JC  
WHRoeder:
Where does it say a httpS can be done?

From https://www.mql5.com/en/docs/common/webrequest:

Server port is automatically selected on the basis of the specified protocol - 80 for "http://" and 443 for "https://". 

whroeder1
16098
whroeder1  
I stand corrected; the mql4 doc also states that.
dbuckle
222
dbuckle  
alaeddin, I know this is an old thread but did you work out why you were getting error 5203.  I'm getting the same and I can't see what might be wrong.  I'm just POSTing to HTTP with 1 header and a body.
Alain Verleyen
Moderator
33493
Alain Verleyen  
dbuckle:
alaeddin, I know this is an old thread but did you work out why you were getting error 5203.  I'm getting the same and I can't see what might be wrong.  I'm just POSTing to HTTP with 1 header and a body.
Show your code if you want help.
nikinanaliu
28
nikinanaliu  
Alain Verleyen:
Show your code if you want help.


i have the same error 5203 when sending POST to my https apache server. i just post only one param to the server and the http is works ok. 

ms=(long)TimeCurrent()%1000;
   string str = "data="+(string)TimeCurrent()+"."+(string)ms; // post data variables to send
   StringToCharArray(str,data);
   //string b = CharArrayToString(data);
   //Print("Test:",b); // just test if good ... it is.
   
   //Print("Start post webRequest");
   ResetLastError();
   //res = WebRequest("POST",url,requestHeaders,cookies,3000,data,ArraySize(data),result,returnHeaders); 
   res = WebRequest("POST",url,requestHeaders,3000,data,result,returnHeaders); 
   if(res==-1) 
     { 
      int errorcode=GetLastError();
      Print("Error in WebRequest. Error code  =",errorcode," . Res = ",res); 
      //--- 也许URL没有列出,显示需要添加地址的信息 
      MessageBox("Error in WebRequest. Error code = "+errorcode+". Res = "+res,MB_ICONINFORMATION); 
     } 

and i use wireshark to capture frames and i found that TLS is work ok and mt5 can sending hello request after exchange cipher spec but no any more frames . if i use chrome to connnect https server i can see chrome send application data after sending tls hello request .

To add comments, please log in or register