Skip to content

Host verification failure for packages in SSH remotes at a non-standard port #38777

@jmert

Description

@jmert

With Julia master (1.6.0-DEV.1707), I cannot Pkg.update() any packages or registries which are located at an SSH address that includes a custom port number. I've changed the actual hostname, but I get something like:

julia> Pkg.update("Arc")
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `ssh://[email protected]:857/user/Arc.jl.git`
SSH host verification: the server `git.mydomain.lan` is not a known host. Please run `ssh-keyscan git.mydomain.lan >> /home/user/.ssh/known_hosts` in order to add the server to your known hosts file and the try again.
ERROR: failed to fetch from ssh://gitea@git.mydomain.lan:857/user/Arc.jl.git, error: GitError(Code:ERROR, Class:Net, user cancelled hostkey check)
Stacktrace:
...

I've gotten lost digging through how Pkg, LibGit2, and the host verification callbacks all interact, but I did find that if I insert just above

host == unsafe_string(known_host.name) || continue
the line

contains(host, "git.mydomain.lan") && @show (host, unsafe_string(known_host.name))

the mismatch appears to be because host = "git.mydomain.lan" while the known_host.name == "[git.mydomain.lan]:857" so the known host is always skipped over and verification fails.

Metadata

Metadata

Labels

packagesPackage management and loading

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions