1

When I run the following command testcafe --ssl pfx=path/to/file.pfx safari mytestfile.js, I always immediately get a mac verify failure error message in the terminal window.

I created my .pfx file using openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 999999 -nodes

Questions:

  • Am I using the wrong .pfx file?
  • What is causing this error?
  • How would I go about fixing this issue?

I have tried using the instructions here (https://devexpress.github.io/testcafe/documentation/using-testcafe/programming-interface/createtestcafe.html), but even that doesn't work.

Any help would be greatly appreciated! :)

Vladimir A.
  • 2,202
  • 2
  • 10
  • 28
TallKU
  • 179
  • 12
  • Please check if the issue is reproducible without TestCafe. You can use the following example from NodeJs documentation: [https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener) If so the problem is in your .pfx file. – aleks-pro Mar 27 '20 at 14:33
  • Also, you might need to specify the `passphrase` option together with a path to your .pfx file: `testcafe --ssl pfx=path/to/file.pfx;passphrase=sample safari mytestfile.js` – aleks-pro Mar 27 '20 at 14:51
  • I tried the last comment (adding the passphrase). I keep getting errors though when executing the command `mac verify failure`. I also don't fully understand how creating an HTTPS server will help me test an actually URL (I do not have my application code running locally on my computer). Am I supposed to point TestCafe servers to this https server? – TallKU Mar 30 '20 at 14:16
  • No, you don’t need to use TestCafe to test you pfx file. Create your own https server following the instructions from [https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener](https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener) and use your pfx file – AlexanderMoiseev Mar 31 '20 at 12:30
  • yea, I created that successfully using my own .pfx file. Everything worked. The issue is that using my .pfx file still throws the JS error for 'Insecure Document' when having Apple Pay on a particular page that I am testing. I am trying to figure out how to make a secure connection in order to automation the Modal Window that Apple Pay opens when using Safari. It probably isn't possible with all the security parameters built around it. – TallKU Mar 31 '20 at 18:03
  • To find a possible solution, we need to reproduce your scenario on our side. So, please provide a simple project and your test code for research. – aleks-pro Apr 03 '20 at 07:08

0 Answers0