Skip to content

Honour the self-signed setting when signing in to the CLI with a password #2082

Closed

Description

@ChiragAgg5k

Tracks PR #2081.

Plan

Goal: Let appwrite login sign in with email and password to a self-hosted instance that uses a self-signed certificate, and keep the new session trusting that certificate for later commands.

What changes (all in #2081):

  • templates/cli/internal/cmd/login.go: loginWithPassword now builds its client with SetSelfSigned(selfSigned), so the POST /account/sessions/email call, the MFA challenge and the /account lookup all accept the certificate. Before, only the /health/version endpoint check used the stored selfSigned preference, so sign-in failed with x509: certificate signed by unknown authority.
  • The new session is written with selfSigned: true when the setting is on, so later commands and token refresh pick it up.
  • New login --self-signed true|false flag (same string form as client --self-signed) that overrides the stored preference; rejected with --switch and against Cloud, like --password, --mfa and --code.
  • templates/cli/internal/cmd/login_test.go: regression tests against httptest.NewTLSServer for the stored preference, the flag without a prior client call, --self-signed false overriding a stored true, MFA over a self-signed certificate, invalid values, and rejection with Cloud and --switch.

Remaining steps: None beyond the linked PR; it is the full change. The fix reaches users with the next CLI release.

Done when:

Activity

  1. self-assigned this
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions