1

I got stuck lately trying to understand how to setup environment in IntelliJ for some specific API which requires .key .crt .p12 and password/passphrase. While I got everything setup correctly in Postman I cant really set it up in my Selenium framework. I was told to use cURL commands to work it out but that's not fully working for me...I'm using this command

curl.exe -v --key X.Y.key --cert X.Y.crt -H 'Content-type: application/json' -d {} https://endpoint.xxx

After running this command I'm prompted to "Enter host password for user 'tFormat':"

Is this my username (different from X.Y.key name?) From my company I received .key/.crt/p12 file including passphrase all working in Postman but when I tried to type my password I cant see anything typing but anyway I'm getting:

* Connected to endpoint.xxx (11.22.33.44) port 443 (#0)
* schannel: disabled automatic use of client certificate
* schannel: Failed to import cert file X.Y.crt, last error is 0x80092002

I also tried --user "name:password" (which should be "tFormat:passphrase" or "X.Y:passphrase") with different configurations of name and password but with no positive results.

Any ideas what am I doing wrong or anyway how can I use command line code inside my methods?

Thanks

Shawn
  • 4,064
  • 2
  • 11
  • 23
  • 1
    for cURL error see this post: https://stackoverflow.com/questions/64215236/c-libcurl-schannel-failed-to-import-cert-file-cert-cer-last-error-is-0x8009 – pcalkins Feb 24 '23 at 19:20
  • 1
    for Selenium, seems like you'd just need to add it to your cert store, but there are some settings you can configure regarding SSL/certs... what errors do you see when running Selenium? – pcalkins Feb 24 '23 at 19:24
  • Error is: java.net.SocketException: Connection reset Default APIInvoke method in my framework does not include certificate data. I need to find a way to pass it into that method. I've got my certificate added into File/Setting/Tools/Server – Karol Odwald Feb 27 '23 at 08:20
  • 1
    did you add to the browser?: https://support.google.com/chrome/a/answer/3505249?hl=en – pcalkins Feb 27 '23 at 17:30
  • 1
    So if this works manually but not automated, you may just need to choose a profile for Selenium to use. (one with the cert installed) You may also want to review this FAQ topic: https://chromium.googlesource.com/chromium/src/+/main/net/data/ssl/chrome_root_store/faq.md – pcalkins Feb 27 '23 at 18:13

0 Answers0