def connect_to_mycroft
      if ARGV.include?("--no-tls")
        @client = TCPSocket.open(@host, @port)
      else
        socket = TCPSocket.new(@host, @port)
        ssl_context = OpenSSL::SSL::SSLContext.new
        ssl_context.cert = OpenSSL::X509::Certificate.new(File.open(@cert))
        ssl_context.key = OpenSSL::PKey::RSA.new(File.open(@key))
        @client = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)
        begin
          @client.connect
        rescue
        end
      end
    end
def connect_to_mycroft
      if ARGV.include?("--no-tls")
        @client = TCPSocket.open(@host, @port)
      else
        socket = TCPSocket.new(@host, @port)
        ssl_context = OpenSSL::SSL::SSLContext.new
        ssl_context.cert = OpenSSL::X509::Certificate.new(File.open(@cert))
        ssl_context.key = OpenSSL::PKey::RSA.new(File.open(@key))
        @client = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)
        begin
          @client.connect
        rescue
        end
      end
    end
connects to mycroft aka starts tls if necessary