Cita:
Empezado por marioerp
Buenas.
Adjunto proyecto de consultar ruc de la set... Tengo problemas para anhadirle el certificado, si pueden corregir donde estoy errando seria de gran ayuda.
|
Buenas
1- El certificado debe estar instalado en la PC
2- No haz incluido el procedure
findclientcertificate
Código Delphi
[-]procedure TdmRIO.findClientCertificate(
const Sender: TObject; const ARequest: TURLRequest;
const ACertificateList: TCertificateList; var AnIndex: Integer);
var
i : integer;
begin
for I := 0 to ACertificateList.Count-1 do begin
if SameText(ACertificateList[i].SerialNum,'74926b31c944fe9648575fa99162761a') then begin
AnIndex := I;
break;
end;
end;
end;
3- "Descomenta" esta parte
Código Delphi
[-] HTTPRIOConsultaRUC.HTTPWebNode.ClientCertificate.SerialNum := '74926b31c944fe9648575fa99162761a';
HTTPRIOConsultaRUC.HTTPWebNode.OnNeedClientCertificate := findClientCertificate;
HTTPRIOConsultaRUC.OnBeforeExecute := BeforeExecute;
HTTPRIOConsultaRUC.OnAfterExecute := AfterExecute;
4- Utiliza el protocolo TLS1.1
Código Delphi
[-]HTTPRIOConsultaRUC.HTTPWebNode.SecureProtocols := [THTTPSecureProtocol.TLS11];
Saludos