Orange-OpenSource / hurl

Hurl, run and test HTTP requests with plain text.
https://hurl.dev
Apache License 2.0
13.22k stars 495 forks source link

The http two ways integration test ssl/client_authentication.hurl fails on Windows. #1399

Open lepapareil opened 1 year ago

lepapareil commented 1 year ago

Steps to reproduce

With powershell, clone hurl project and execute:

./bin/test/test.ps1

Integration test file that fails

ssl/client_authentication.hurl

Command that fails

hurl ssl/client_authentication.hurl --cacert ssl/server/cert.selfsigned.pem --cert ssl/client/cert.pem --key ssl/client/key.pem --verbose

What is the current bug behavior?

(58) schannel: certificate format compatibility error  for ssl/client/cert.pem

What is the expected correct behavior?

Hello world!

Relevant logs and/or screenshots

>>> error in return code
expected: 0  actual:3
* Options:
*     fail fast: true
*     follow redirect: false
*     insecure: false
*     max redirect: 50
*     retry: false
*     retry max count: 10
* ------------------------------------------------------------------------------
* Executing entry 1
*
* Cookie store:
*
* Request:
* GET https://localhost:8003/hello
*
* Request can be run with the following curl command:
* curl --cacert ssl/server/cert.selfsigned.pem --cert ssl/client/cert.pem --key ssl/client/key.pem 'https://localhost:8003/hello'
*
error: HTTP connection
  --> ssl/client_authentication.hurl:1:5
   |
 1 | GET https://localhost:8003/hello
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (58) schannel: certificate format compatibility error  for ssl/client/cert.pem
   |

Output of checks

fnuttens commented 5 months ago

@lepapareil you are using curl with the schannel backend, which doesn’t support loading a client certificate from a PEM file. You have to load the certificate from Windows’ certificate store (see https://curl.se/docs/manpage.html#-E). Unfortunately hurl tries to fetch a file instead of a stored certificate.