Ver Mensaje Individual
  #2621  
Antiguo 19-01-2022
Ivan_Teleco Ivan_Teleco is offline
Registrado
 
Registrado: jul 2021
Posts: 7
Reputación: 0
Ivan_Teleco Va por buen camino
Ayuda Con Enviar Xml

Hola buenas, antes de nada gracias por todo el codigo que la gente comparte.
Estoy usando un php para realizar el envio, y cuando introducco los certificados PEM siempre me responde con nada, si no los pongo al menos me dice que no introduje los certificado, pero almenos responde, alguien sabe donde puede estar el problema??

Los certificados PEM los he sacado con OPENSSL
openssl pkcs12 -in C:\Users\IndaG\Desktop\TBAI_PRUEBAS\PFX.pfx -out C:\Users\IndaG\Desktop\TBAI_PRUEBAS\ca.pem -cacerts -nokeys
openssl pkcs12 -in C:\Users\IndaG\Desktop\TBAI_PRUEBAS\PFX.pfx -out C:\Users\IndaG\Desktop\TBAI_PRUEBAS\client.pem -clcerts -nokeys
openssl pkcs12 -in C:\Users\IndaG\Desktop\TBAI_PRUEBAS\PFX.pfx -out C:\Users\IndaG\Desktop\TBAI_PRUEBAS\key.pem -nocerts

Código PHP:
 <?php

       $xmlStr 
file_get_contents('.\firmado.xml');
               
        
$ch curl_init('URL');
        
curl_setopt($chCURLOPT_POST1);
        
curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
curl_setopt($chCURLOPT_SSLCERT,'/client.pem');
        
curl_setopt($chCURLOPT_SSLKEY,'/key.pem');
        
curl_setopt($chCURLOPT_CAINFO,'/ca.pem');
        
curl_setopt($chCURLOPT_SSLKEYPASSWD"INDAVE");
        
curl_setopt($chCURLOPT_SSL_VERIFYPEER1);
        
curl_setopt($chCURLOPT_POSTFIELDS$xmlStr);
        
curl_setopt($chCURLOPT_HTTPHEADER, array('Content-Type: application/xml; charset=utf-8')); 


        
$resp curl_exec($ch); 
        
$size_response curl_getinfo($chCURLINFO_HEADER_SIZE);
        echo
$size_response;
         
$header_response substr($resp0$size_response);
         
$body_response substr($resp$size_response);
        echo 
$body_response;
       
//echo $resp;

       
curl_close($ch);

Última edición por Neftali [Germán.Estévez] fecha: 19-01-2022 a las 13:25:37. Razón: Añadir TAGs al código
Responder Con Cita