http transport: support cert check for proxies Refactor certificate checking so that it can easily be called for proxies or the remote server.