I'm pretending to be a keyserver to observe what dirmngr does.
in terminal A, i do:
nc -l -p 12345
in terminal B, i do:
gpg --keyserver 127.0.0.1:12345 --search `<dkg@fifthhorseman.net>`
in A, i see:
GET /pks/lookup?op=index&options=mr&search=<dkg@fifthhorseman.net> HTTP/1.0 Host: localhost:12345 Pragma: no-cache Cache-Control: no-cache
If i then send back:
HTTP/1.1 502 bad gateway
then dirmngr closes the connection and logs:
2019-05-13 18:12:53 dirmngr[12603.6] error accessing 'http://127.0.0.1:12345/pks/lookup?op=index&options=mr&search=%3Cdkg%40fifthhorseman%2Enet%3E': http status 502 2019-05-13 18:12:53 dirmngr[12603.6] marking host dead due to a 502 (Bad Gateway) 2019-05-13 18:12:53 dirmngr[12603.6] marking host '127.0.0.1' as dead 2019-05-13 18:12:54 dirmngr[12603.6] host '127.0.0.1' marked as dead 2019-05-13 18:12:54 dirmngr[12603.6] command 'KS_SEARCH' failed: No keyserver available 2019-05-13 18:12:54 dirmngr[12603.6] DBG: chan_6 -> ERR 167772346 No keyserver available <Dirmngr>
note that the log claims to have percent-escaped the angle brackets (< and >) and the @ sign in the request, but on the wire it did not percent-escape them.
Some keyservers have problems if the client does not percent-escape, so this risks making those keyservers unusable.
No matter what dirmngr decides to do about percent-escaping on the wire, its logs should not claim to be doing percent-escaping if it is not actually doing percent-escaping.