     # back...
     opts = %{ port: TestHelper.auth_port}
     {:error, _why} = Client.start opts
-    
+
     # We should fail if we pass invalid credentials, make sure...
     opts = %{ port: TestHelper.auth_port,
               auth: %{ "user" => "oops", "pass" => "oops22"}}

  use ExUnit.Case, async: false
  alias Nats.Client

  @tag requires_gnatsd: true
  test "Open a default client" do
    subject = "FOO-bar"

    {:error, _rest} = Client.start(%{host: ""})

    {:error, _rest} = Client.start(%{timeout: 0})
    
    {:ok, con } = Client.start_link
    {:ok, ref1} = Client.sub(con, self(), subject)


    :ok = Client.flush(con)
  end

  @tag capture_log: true
  test "Client wants tls vs. server doesn't" do
    opts = %{ tls_required: true, port: TestHelper.default_port, }
    {:error, _why } = Client.start opts
    opts = %{ auth_opts: %{}, tls_required: true, port: TestHelper.default_port, }
    {:error, _why } = Client.start opts
  end

  @tag capture_log: true
  test "Client doesn't want tls vs. server does" do
    # check whether we
    opts = %{ tls_required: false, port: TestHelper.tls_port, }
    {:error, _why } = Client.start opts
    opts = %{ auth_opts: %{}, tls_required: false, port: TestHelper.tls_port, }
    {:error, _why } = Client.start opts
  end

  @tag capture_log: true
  test "Client and server both want tls" do
    opts = %{ tls_required: true, port: TestHelper.tls_port, }
    {:ok, conn} = Client.start opts
