Update the puppetdb terminus to call Puppet.runtime[:http] and use that to make network connections. When running in puppet apply this will use the agent's implementation. When running in puppetserver, it will use the server's implementation. The http always returns instances of Puppet::HTTP::Response and raises Puppet::HTTP::HTTPError or a subclass.
I'm working on changing the server's HTTP client implementation to provide the new interface. Does that interact with this work at all? Specifically, do y'all use Puppet Server's client for anything, or just the one from the Puppet library?