Has anyone else received an error "HTTPSConnectionPool" when trying to place a test order in Sandbox?

This is the full error message on our website server we're receiving when I followed the steps at https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/requesting_an_apple_pay_payment_session:


HTTPSConnectionPool(host='apple-pay-gateway-cert.apple.com', port=443): Max retries exceeded with url: /paymentservices/startSession/paymentSession

(Caused by SSLError(SSLError(336445449, u'[SSL] PEM lib (_ssl.c:2693)'),))


And error message on my iPhone is:


"Apple Pay Not Completed.

This website was not able to complete the payment. Please try again."


We are trying with the test card numbers from this page - https://developer.apple.com/apple-pay/sandbox-testing/

I know this is 3 years late but this was the only page I found remotely close to the error message I also received. I eventually figured it out for myself and perhaps this will help someone else who comes along and gets this same error.

The merchant identity certificate that Apple sends back is in DER format (binary). I attempted to use it immediately together with my private key and received the error above about "max retries" which completely sent me down the wrong path for a long time...

However, I needed to convert the Apple certificate to PEM first (my private key was already in this format).

I used openssl on the command line like this:

openssl x509 -inform der -in apple_merchid.cer -outform pem -out apple_merchid.pem

Where the binary Apple certificate is "apple_merchid.cer". This command will output the file "apple_merchid.pem".

Once I had both my private key and certificate in this readable format (you'll know it because the certificate will be bracketed with "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----"), it worked.

Has anyone else received an error "HTTPSConnectionPool" when trying to place a test order in Sandbox?
 
 
Q