Apple Pay Web .NET Could Not Create SSL/TLS Secure Channel on Merchant Validation

624 Views Asked by At

I'm trying to integrate Apple Pay on our production website. I managed to complete the implementation on my local machine and successfully tested it with an Apple sandbox account. However, when we ported the integration to our production environment, on the merchant validation step, it fails with this error: "Could Not Create SSL/TLS Secure Channel".

Some information:

  • We checked multiple times that the merchant ID, domain name and all other parameters we send for merchant validation are correct
  • Our production server supports TLS1.2 and the cipher suites required by Apple pay to work
  • The domain validation has been done
  • The TLS certificate we send for the merchant validation has been created in compliance with the Apple documentation guidelines and the server process has the right permissions to access it
  • We explicitly set the security protocol as TLS 1.2 in the code
  • We tried turning off the firewall but it didn't change anything
  • Our server uses .NET version 4.5.2

The certificate for TLS handshake is a .pfx file that we made by combining the .pem and .key files obtained during the certificate creation procedure as described in the documentation. We add the certificate directly into the web request via code, like this (vb.net):

 ServicePointManager.Expect100Continue = True
 ServicePointManager.SecurityProtocol = CType(12288, SecurityProtocolType) Or CType(3072, SecurityProtocolType) Or CType(768, SecurityProtocolType) Or SecurityProtocolType.Tls

 Dim _request As HttpWebRequest = HttpWebRequest.Create(_validationUrl)
 Dim _certFile As String = Path.Combine(applePayCertificatePath, applePayCertificateName)
 Dim _certificate As New X509Certificate2(_certFile, applePayCertificatePassword)

 _request.ClientCertificates = New X509CertificateCollection({_certificate})
 _request.ClientCertificates.Add(_certificate)

We searched all the web for a solution but we can't seem to find one. It looks like a server configuration/networking issue since, as I said, it works perfectly on my local machine.

Any insight on the matter would be greatly appreciated.

Thanks

0

There are 0 best solutions below