Implemented TLS functionality and made Ruby 2.0 compatible