Closes GH-18133
This also removes old LibreSSL checks as minimum that compiles is 3.5.0
The main purpose of this is to better handle the API difference and add an inital work to separate PHP and OpenSSL logic. This is really just the first step and further changes are coming after that. Closes GH-16918