Patching PHP 5.6 SOAP Proxy Bug
Recently I wrote my first PHP patch to fix an issue with the SOAP module when using HTTP proxies in an unsupported version of PHP (5.6).
We had been running PHP 5.5 in production for years without any issues. However we were using PHP PECL modules that did not support PHP 7. So the decision was made to upgrade to PHP 5.6 in the short term, to at least stay as up to date as we could without having to remove the PECL module dependency we had.
This upgrade introduced an issue with using TLS certificate verification when using SOAP with an HTTP proxy. There was already a bug opened, however the PHP team had only fixed it in the current supported version (PHP 7).
I took a look at the patch and naively thought I could just re-build our PHP RPM with the upstream patch. However the patch would not apply as there have been significant changes between PHP 5.6 and 7.
Although I do not know C programming very well, I spent a couple of hours trying to back port the logic changes in the upstream patch into PHP 5.6 and have got a working version of the patch, which I then submitted back to the PHP issue.
I have since received feedback from another company who were in a similar situation and could not upgrade to PHP 7, and have used my patch to solve the same problem. I’m very glad they could find some use for it.