Hello Everyone,
I am trying to integrate apple pay on my website and have followed the following steps.
- Created a merchant identifier in my apple developer account.
- Generated a payment processing certificate using Certificate signing Request generated through keychain.
- Downloaded the certificate and converted that to pem file using the following command
openssl x509 -inform DER -in apple_pay.cer -out apple_pay.pem
- Imported the cer file into keychain and exported .p12 file and generated private key using the following command.
openssl pkcs12 -in Certificates.p12 -out private_key.pem -nocerts
- Utilizing apple_pay.pem and private_key.pem files for merchant verification call and getting the following response.
cURL Error: OpenSSL SSL_read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0
Trying 17.141.128.7:443...\n* TCP_NODELAY set\n* Connected to apple-pay-gateway.apple.com (17.141.128.7) port 443 (#0)\n* ALPN, offering h2\n* ALPN, offering http/1.1\n* successfully set certificate verify locations:\n* CAfile: /etc/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs\n* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256\n* ALPN, server accepted to use http/1.1\n* Server certificate:\n* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; CN=apple-pay-gateway.apple.com\n* start date: Dec 19 00:22:44 2024 GMT\n* expire date: Mar 12 19:42:00 2025 GMT\n* issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 1 - G1\n* SSL certificate verify ok.\n> POST /paymentservices/startSession HTTP/1.1\r\nHost: apple-pay-gateway.apple.com\r\nAccept: /\r\nContent-Type: application/json\r\nContent-Length: 143\r\n\r\n* upload completely sent off: 143 out of 143 bytes\n* OpenSSL SSL_read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0\n* Closing connection
I also tried to include AppleWWDRCAG2 and AppleRootCA-G2 certificated but same response every time.