0
Rephrasing the question...
I was able to get an answer from the webserve, but it is returning the following error:
I need to encapsulate a digital Ceritificado together with the requisition and do not know how to do it, so I researched I need to do something with the properties of the class Tidssliohandlersocketopenssl, but I do not know how to proceed.
It follows the properties I researched:
IdSSLIOHandlerSocketOpenSSL.SSLOptions.CertFile IdSSLIOHandlerSocketOpenSSL.SSLOptions.KeyFile IdSSLIOHandlerSocketOpenSSL.SSLOptions.RootCertFile
Wall I need to put the path of some file on them, I don’t know.
Follow the code I’m using:
procedure TForm2.Button2Click(Sender: TObject);
var
str: TStringList;
strResp : TStringStream;
IdHTTP: TIdHTTP;
IdSSLIOHandlerSocketOpenSSL: TIdSSLIOHandlerSocketOpenSSL;
begin
str := TStringList.Create;
strResp := TStringStream.Create('');
IdHTTP := TIdHTTP.Create(nil);
IdSSLIOHandlerSocketOpenSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP);
IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvTLSv1_2;
IdHTTP.IOHandler := IdSSLIOHandlerSocketOpenSSL;
IdHTTP.Request.CustomHeaders.Clear;
IdHTTP.Request.CustomHeaders.AddValue('Role-Type','IMPEXP');
IdHTTP.Post('https://val.portalunico.siscomex.gov.br/portal/api/autenticar',str, strResp);
Memo1.Lines.Text := strResp.ToString;
end;
You should leave a comment on the questions indicated or offer a reward for your answers. And don’t open a new question with their link. If so, you could create your own question including your specific code and scenario.
– Leandro Angelo