Create a SSL Socket to a specified host and port: socket = ssl_connect('github.com',443) # => # Or create a temporary SSL Socket that automatically closes: ssl_socket('github.com',443) do |socket| socket.write("GET /\r\n") puts socket.read end