Indy 8“连接正常关闭”错误

时间:2016-09-22 12:29:43

标签: c++ connection c++builder indy indy-8

IdConnectionInterceptOpenSSL->SSLOptions->Method = sslvSSLv23;
IdConnectionInterceptOpenSSL->SSLOptions->Mode = sslmClient;
IdConnectionInterceptOpenSSL->SSLOptions->VerifyDepth = 0;

//....

TCHAR* SIR = SIRX[ix].c_str();

AnsiString rtf;
TStringStream * Send = new TStringStream(rtf) ;
Send->Write(SIR, (SIRX[ix]).Length());  // <-- new
Send->Position = 0;

TMemoryStream *Receive = new TMemoryStream() ;

AnsiString ADRESA = "https://webservicesp.anaf.ro:443/PlatitorTvaRest/api/v1/ws/tva";

IdHTTP->Request->Accept = "application/json";
IdHTTP->Request->ContentType = "application/json";
IdHTTP->Request->Connection = "Keep-Alive";

IdHTTP->Post(ADRESA, Send, Receive);

如果我使用直接互联网连接,它可以正常工作。

当我使用代理服务器进行Internet连接时,会出现我的问题。

我把

IdHTTP->Request->ProxyServer = PROXY_SERVER;
IdHTTP->Request->ProxyPort = StrToInt(PROXY_PORT);
if(PROXY_USER.IsEmpty() == false)
    IdHTTP->Request->ProxyUsername = PROXY_USER;
if(PROXY_PASSW.IsEmpty() == false)
    IdHTTP->Request->ProxyPassword = PROXY_PASSW;

但错误如下所示:connection closed gracefully对第一次审讯,之后,同一审讯给出501 Not Implemented

问题出在哪里?有没有解决方案?

0 个答案:

没有答案