feat: extend certificate pinning to all TLS protocols and add SSH

host-key pinning
This commit is contained in:
2026-06-29 19:23:10 +02:00
parent e7ed3a334e
commit fc65ea8340
19 changed files with 355 additions and 25 deletions
+11
View File
@@ -87,6 +87,17 @@ type DownloadRequest struct {
Ctx context.Context
SSHKnownHosts string // path to known_hosts file (SFTP)
SSHInsecure bool // skip SSH host key verification (SFTP)
// PinnedCertHash pins a TLS leaf certificate by its SHA-256 hash
// (lowercase hex). Applied to every TLS-bearing protocol: HTTPS,
// FTPS, Gemini, WebDAVS. Empty disables pinning.
PinnedCertHash string
// PinnedHostKey pins an SSH host key. Accepted formats:
// "SHA256:<base64>" — OpenSSH fingerprint (ssh-keygen -lf)
// "<hex>" — raw SHA-256 hex of the key wire format
// Applied to SFTP only. Empty disables pinning.
PinnedHostKey string
}
// DownloadResult represents a download result