Ver Mensaje Individual
  #832  
Antiguo 18-06-2021
tejano tejano is offline
Miembro
 
Registrado: dic 2020
Posts: 129
Reputación: 4
tejano Va por buen camino
Cita:
Empezado por luismartin Ver Mensaje
Hola tejano. He intentado la prueba por línea de comandos, teniendo ya generado el gzip, en un fichero llamado lroe_1624012540.gz, pero me da problemas . Por lo visto, algo del certificado, pero parece más cosa del certificado del servidor (lógicamente, he ocultado datos sensibles):

Código:
$ curl --insecure --cert-type P12 --cacert cert_certFNMTEmpresa.pfx --pass contraseña -H "Accept-Encoding:gzip" -H "Content-Encoding:gzip" -H "Content-Type:application/octet-stream" -H "eus-bizkaia-n3-version:1.0" -H "eus-bizkaia-n3-content-type:application/xml" -H "eus-bizkaia-n3-data:{\"con\":\"LROE\",\"apa\":\"1.1\",\"inte\":{\"nif\":\"BXXXXXXXX\",\"nrs\":\"NOMBRE EMPRESA\"},\"drs\" :{\"mode\":\"240\",\"ejer\":\"2021\"}}" -v "https://pruesarrerak.bizkaia.eus/N3B4001M/kontsulta" --data-binary lroe_1624012540.gz --output respuesta.gz -D cabeceras_respuesta.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 80.245.2.232...
* TCP_NODELAY set
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to pruesarrerak.bizkaia.eus (80.245.2.232) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* error setting certificate verify locations, continuing anyway:
*   CAfile: cert_certFNMTEmpresa.pfx
  CApath: none
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [81 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [4450 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [527 bytes data]
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
{ [36 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
} [7 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [134 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / DHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: jurisdictionC=ES; jurisdictionST=BIZKAIA; jurisdictionL=BILBAO; businessCategory=Government Entity; postalCode=48009; C=ES; ST=BIZKAIA; L=BILBAO; street=GRAN V�A 25; O=BIZKAIKO FORU ALDUNDIA - DIPUTACION FORAL DE BIZKAIA; OU=IT; serialNumber=P4800000D; CN=pruesarrerak.bizkaia.eus
*  start date: Jul  3 12:41:06 2020 GMT
*  expire date: Jul  3 12:41:06 2022 GMT
*  issuer: C=ES; O=IZENPE S.A.; OU=BZ Ziurtagiri publikoa - Certificado publico EV; CN=CA de Certificados SSL EV
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
} [5 bytes data]
> POST /N3B4001M/kontsulta HTTP/1.1
> Host: pruesarrerak.bizkaia.eus
> User-Agent: curl/7.64.0
> Accept: */*
> Accept-Encoding:gzip
> Content-Encoding:gzip
> Content-Type:application/octet-stream
> eus-bizkaia-n3-version:1.0
> eus-bizkaia-n3-content-type:application/xml
> eus-bizkaia-n3-data:{"con":"LROE","apa":"1.1","inte":{"nif":"BXXXXXXXX","nrs":"NOMBRE EMPRESA"},"drs" :{"mode":"240","ejer":"2021"}}
> Content-Length: 18
> 
} [18 bytes data]
* upload completely sent off: 18 out of 18 bytes
* OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
100    18    0     0  100    18      0     68 --:--:-- --:--:-- --:--:--    68
* Closing connection 0
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
Como decía, lroe_1624012540.gz es donde tengo el gzip conteniendo el XML del LROE (que a su vez contiene la factura TBAI)
En tu caso creo que el certificado no es P12, es pfx. Puede ser que vaya por ahí la cosa.

Saludos
Responder Con Cita