Backport OpenSSL 3 support to PyPy 2.7

Merged Stefano Rivera requested to merge branch/py2.7-openssl3 into branch/default

Fixes: #3643 (closed)

Some bits backported from py3.7, some from upstream cPython's OpenSSL 3 support, and some from Debian's 2.7 OpenSSL 3 support.

Merge request reports