Local Registry RSA key Problem

I can expand on this.

  1. JULIA_PKG_USE_CLI_GIT is the preferred solution and documented in https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh_keys.md#2-using-an-external-git-binary-with-julias-package-manager. The main limitation is that it’s only available from Julia 1.7 and, obviously, requires an external git installation.
  2. ssh-keygen -t rsa -b 4096 -m PEM still generates a key which Julia Pkg can use with libgit2/libssh2. However, GitHub will not accept the key, but if you’re using it with other git services they may be more accepting.
  3. There is no other key type that can be used with existing Julia binary downloads through libgit2/libssh2. Although version 1.9.0 of libssh2 does support ECDSA keys, that requires a specific crypto backend, which is not the one Julia is built with.
  4. If you build Julia yourself, it should be possible to configure it so that libssh2 understands ECDSA keys.
  5. libssh2 master 1.10.0 contains support for ECDSA keys with the mbedtls backend, which Julia uses, assuming everything is built with the appropriate feature enabled. This may eventually make its way into Julia’s binary downloads. This will be available for Julia 1.8 and later (and is already available in Julia 1.8-beta1). You may want to set the environment variable SSH_KEY_PATH to point to your ECDSA key.
  6. If you do try to use a non-RSA key with Julia you will get repeatedly prompted for the key location. The first time this is because it indeed doesn’t know where the key is (unless you have told it with SSH_KEY_PATH and SSH_PUB_KEY_PATH) but all the following times it is because libssh2 hasn’t been built with support for reading the key. Yes, this is a very unhelpful behavior and you can only find out what’s going on by patching libssh2.
  7. See item 1. There’s a possibility that this option could be backported to a future 1.6.x release. This has been backported and will be available in Julia 1.6.6.
8 Likes