moved general purpose SSL/TLS and certificate functions to a library module minor improvements to error reporting