Add X509.check_proxy

Fixes: https://bugzilla.osafoundation.org/show_bug.cgi?id=12947