Closed miyagawa closed 9 years ago
I was thinking about this and hacking a bit and had this question:
Should it be specific to an object? I.e. with verify_SSL, also looking for the CA file (default or explicit)?
That might mean "can_ssl" checks if it's called as object or class method.
I was thinking to instantiate a handle (without connecting) and calling _assert_ssl and _find_CA_file on it and making sure they don't croak.
Should it be specific to an object? I.e. with verify_SSL, also looking for the CA file (default or explicit)?
That sounds like a good idea!
Cherry-picked to master
This implements can_ssl() method that is a public version of _assert_ssl in HTTP::Tiny::Handle, so that wrapper modules and callers can determine if an HTTPS request can be made, instead of running one and getting a runtime exception.