Skip to content

Adding initial HttpRequest to MitmManager methods #290

Closed
@jekh

Description

@jekh

While working on the PR for issue #288, I started to wonder if it would be a good idea to add the initial HttpRequest for the HTTP CONNECT as a parameter to the MitmManager methods. This would allow the MitmManager to impersonate a host based on the Host header from the client, rather than on the actual hostname or the actual certificate returned by the upstream server. I can think of a few cases when the host requested by the client would not match the upstream server's hostname or server's certificate:

  1. A DNS server or filter has changed the DNS resolution of the client-requested host to resolve to some other host.
  2. Both of the following conditions are true:

Adding in the initialRequest to the MitmManager would allow the MitmManager to return a valid certificate to the client. It would still be up to the MitmManager to determine whether or not to trust the upstream server, just as it is today, but at least the client would trust the MitmManager's certs.

What do you think, @ganskef? This would of course be a breaking change to MitmManager, so I always want to be cautious about such things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions