Further certificate checks can be added with a custom hook.
For more information, see
SSL_verifycn_name 
. The hook should return 0 or 1
for fail and pass respectively. The hook is called once for each
certificate in the certificate chain.
The following arguments are
passed to the hook:
- $_[0] is a true or false value indicating what OpenSSL's view of
the cert.
- $_[1] is a C-style memory address of the certificate store.
- $_[2] is a string containing certificate's issuer and owner.
- $_[3] is a string containing any errors encountered or 0 if there
were no errors.
- $_[4] is a C-style memory address of current certificate in the
chain.