Implement custom tls options

This allows users of the API to either specify a simple CA-File for
certificate verification, or a custom SSLContext in order for a more
fine-grained control of the TLS options they want to use.

As of now, no additional tests were added, but the existing tests were
changed to reflect the changes in internal methods, so that they can
still pass