When trying to send a key to a keyserver without GNUPGHOME being set, it seems dirmngr does not default to using ~/.gnupg/dirmngr.conf.
Setup
- GnuPG 2.2.21
- Linux 5.7.15
- Tor 0.4.3.6
- example ~/.gnupg/dirmngr.conf file:
use-tor keyserver hkp://zkaan2xfbuxia2wpf7ofnkbz6r5zdbbvxbunvp5g2iebopbfc4iqmbad.onion
Try to upload a key to a keyserver using gpg2 --send-key <keyid>
Expected behaviour
GnuPG uploads the specified key to the keyserver defined in ~/.gnupg/dirmngr.conf
Resulting behaviour
GnuPG instead tries to upload the key to the default keyserver:
gpg: sending key <keyid> to hkps://hkps.pool.sks-keyservers.net
Additional comments
I spent some time trying to change the dirmngr configuration file, including not using Tor in case it was the problem, but each time the result was the same. Starting dirmngr using gpgconf --launch dirmngr did also not change anything. Eventually, I tried setting GNUPGHOME to $HOME/.gnupg and after that the correct keyserver was used. This seemed odd to me since the man pages suggest ~/.gnupg is the default directory used in case GNUPGHOME is not set. But this does not seem to be respected for dirmngr.