Skip to main content

Module hostkey

Module hostkey 

Source
Expand description

SSH host-key fingerprint pinning for well-known Git hosting services (FR-6, FR-7).

Gitway embeds the published SHA-256 fingerprints for GitHub, GitLab, and Codeberg. On every connection the server’s presented key is hashed and the resulting fingerprint is compared against the embedded list for that host. Any mismatch aborts the connection immediately.

§Custom / self-hosted instances

Fingerprints for any host not listed below can be added via a known_hosts-style file at ~/.config/gitway/known_hosts (FR-7). Each non-comment line must follow the format:

hostname SHA256:<base64-encoded-fingerprint>

§Fingerprint sources

Last verified: 2026-04-11

Constants§

CODEBERG_FINGERPRINTS
Codeberg.org’s published SSH host-key fingerprints (SHA-256).
DEFAULT_CODEBERG_HOST
Primary Codeberg SSH host.
DEFAULT_GITHUB_HOST
Primary GitHub SSH host (FR-1).
DEFAULT_GITLAB_HOST
Primary GitLab SSH host.
DEFAULT_PORT
Default SSH port used by all providers.
FALLBACK_HOSTDeprecated
Alias for GITHUB_FALLBACK_HOST; retained so existing callers that reference the old name continue to compile.
FALLBACK_PORT
HTTPS-port fallback for providers that support it (GitHub, GitLab).
GITHUB_FALLBACK_HOST
Fallback GitHub SSH host when port 22 is unavailable (FR-1).
GITHUB_FINGERPRINTS
GitHub’s published SSH host-key fingerprints (SHA-256, FR-6).
GITLAB_FALLBACK_HOST
Fallback GitLab SSH host when port 22 is unavailable.
GITLAB_FINGERPRINTS
GitLab.com’s published SSH host-key fingerprints (SHA-256).

Functions§

fingerprints_for_host
Collects all expected fingerprints for host.