gpg2 can only connect to HKPS keyserver with sudo
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnupg2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have been trying to search for GPG keys on the Mailbox.org HKPS key server, using the following command:
gpg2 --debug-all --keyserver=
This, however, fails with the following output:
-------
gpg: reading options from '/home/
gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache memstat trust hashing cardio ipc clock lookup extprog
gpg: DBG: [not enabled in the source] start
gpg: DBG: chan_3 <- # Home: /home/john/.gnupg
gpg: DBG: chan_3 <- # Config: /home/john/
gpg: DBG: chan_3 <- OK Dirmngr 2.1.15 at your service
gpg: DBG: connection to the dirmngr established
gpg: DBG: chan_3 -> GETINFO version
gpg: DBG: chan_3 <- D 2.1.15
gpg: DBG: chan_3 <- OK
gpg: DBG: chan_3 -> KEYSERVER --clear hkps://
gpg: DBG: chan_3 <- OK
gpg: DBG: chan_3 -> KS_SEARCH -- <email address hidden>
gpg: DBG: chan_3 <- ERR 1 General error <Unspecified source>
gpg: error searching keyserver: General error
gpg: keyserver search failed: General error
gpg: DBG: chan_3 -> BYE
gpg: DBG: [not enabled in the source] stop
gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
gpg: secmem usage: 0/65536 bytes in 0 blocks
-------
This confused me, as I am perfectly able to connect and find the key by manually using dirmngr.
What is interesting is that gpg2 is able to connect and find the key when I prefix the command with sudo:
sudo gpg2 --debug-all --keyserver=
This outputs the following:
-------
gpg: WARNING: unsafe ownership on homedir '/home/john/.gnupg'
gpg: reading options from '/home/
gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache memstat trust hashing cardio ipc clock lookup extprog
gpg: DBG: [not enabled in the source] start
gpg: DBG: chan_3 <- # Home: /home/john/.gnupg
gpg: DBG: chan_3 <- # Config: /home/john/
gpg: DBG: chan_3 <- OK Dirmngr 2.1.15 at your service
gpg: DBG: connection to the dirmngr established
gpg: DBG: chan_3 -> GETINFO version
gpg: DBG: chan_3 <- D 2.1.15
gpg: DBG: chan_3 <- OK
gpg: DBG: chan_3 -> KEYSERVER --clear hkps://
gpg: DBG: chan_3 <- OK
gpg: DBG: chan_3 -> KS_SEARCH -- <email address hidden>
gpg: DBG: chan_3 <- S PROGRESS tick ? 0 0
gpg: DBG: chan_3 <- S SOURCE https:/
gpg: DBG: chan_3 <- D info:1:
gpg: data source: https:/
gpg: DBG: chan_3 <- OK
gpg: DBG: iobuf-1.0: close '?'
(1) "mailbox.org Support-Team (mailbox.org Support-Team) <support@mailbox.
4096 bit RSA key 854F20B818A24864, created: 2014-02-15, expires: 2018-02-15
Keys 1-1 of 1 for "<email address hidden>". Enter number(s), N)ext, or Q)uit > Q
gpg: error searching keyserver: Operation cancelled
gpg: keyserver search failed: Operation cancelled
gpg: DBG: chan_3 -> BYE
gpg: DBG: [not enabled in the source] stop
gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
gpg: secmem usage: 0/65536 bytes in 0 blocks
-------
I am using version 17.04 of Ubuntu, and version 2.1.15-1ubuntu7 of gnupg2. Thanks for any help. This really does seem like a bug.
Edit: to clarify, when I manually used dirmngr, I did not use sudo.
I suppose I'll attach my ~/.gnupg/gpg.conf and ~/.gnupg/ dirmngr. conf, just in case. First, here's my gpg.conf.