We have a WordPress website using WooCommerce with Worldpay as the gateway. Orders are not completing Worldpay are giving this error handshake_failure which has something to do with the SSL certificate I think. When we pause Cloudflare it all works fine and the orders complete.
Is there anything we can do to fix this, a rule we can add or a setting we can disable?
Also, if you usually return a response page for us to display to the Shopper
within the time allowed (1 minute), this will not have been displayed.
WorldPay will have displayed to the Shopper the response page file
(resultY.html or resultC.html) held for your installation on the WorldPay
server. This will be your own custom version, if you have supplied one, or,
if not, the WorldPay default version.
There is an SSL certificate up on our server for this domain using Auto SSL as part of Cpanel. I did try disabling the Universal SSL in Cloudflare but this caused the site to go down. Is that what you mean?
I guess you removed the server certificate, which is required for HTTPS to work at all. What I was referring to is client authentication, which could also be done via a certificate. How do you authenticate the callback from Worldpay, so that a customer is not faking it?
Alright, so the authentication takes place via a password.
It most likely is an issue of the TLS version, though I am a bit surprised, as you set as minimum version TLS 1.0 (I dont expect they require SSL, do they?). Try playing a bit with the encryption settings on Cloudflare’s side and check if that makes any difference (e.g. not allowing TLS 1.3).
Alternatively, did you have to define any certificate on Worldpay’s side? Not that it is some certificate pinning issue and they “freak out” because they dont get your certificate but Cloudflare’s.
OK will tweak some of the settings and see if that works.
My client who is the account manager spoke with their support a day or so ago which pointed my in the direction of Cloudflare they said the below but this isn’t the case as it wouldn’t work with Cloudflare disabled either.
They believe fatal alert handshake failure could be caused by SNI being enabled on the hosts server. Worldpay won’t support SNI and it needs to be disabled for it to work.
Thats actually a good point. Cloudflare requires SNI, as they otherwise cant choose the right certificate to send back. If Worldpay does not support SNI I am afraid you wont get it to work together with Cloudflare.
Worldpay should really fix that, SNI is standard these days and particularly a necessity in any shared environment.
Just tried it with TLS 1.3 disabled and again with 1.3 enabled min TLS version set to 1.3.
I think from what you are saying SNI is the issue I will go back to Worldpay and see if there is anything we can do, failing that we may just have to disable Cloudflare.
I worked around the worldpay restriction with the following steps:
Create new worldpay subdomain for the affected domain e.g. worldpay.example.com
Secure worldpay.example.com with a free certificate from https://letsencrypt.org/ (it’s just a tick box during subdomain creation in Plesk 17)
Move callback script for affected domain from its current location to the new worldpay subdomain. e.g. from example.com/cb.php to worldpay.example.com/cb.php
Create new worldpay CNAME entry in Cloudflare DNS page for the affected domain and turn the cloud off for the new CNAME
Login to Worldpay admin interface and update the Payment Response URL for the affected installation to match the new URL you set up at step 3
Test!
Now the worldpay system sends its callback POST to worldpay.example.com/cb.php which Cloudflare sends directly to the server (rather than processing it with its SNI cert) and as long as the server has a valid cert installed from e.g. Let’s Encrypt, it works. No more handshake_failure messages
Thank you for sharing this, unfortunately bit of a noob here!
Please can you explain step 3 in more depth. Basically I can not see a cb file example.com/cb.php. I can see my payment response url is example.com/wc-api/WC_Gateway_WorldPay_Form however when I access the site public folder there is no wc-api file either. I’d really appreciate it if someone could shed some light on this for me please!
I have encoutnered this twice this week, once from worldpay and once from redsys. Both start throwing handshake errors when we move to Cloudflare. For redsys the only solution was changing the callback url from https to http - this solved the issue - we are tying the same with worldpay.