1
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 连接,它可以正常工作。

当我使用代理服务器进行 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

问题出在哪里?有什么解决办法吗?

4

0 回答 0