Skip to content

Issues with HTTPS endpoints behind a proxy server #14

@fpoirotte

Description

@fpoirotte

Hello,

The code in pwclient.xmlrpc fails when a proxy server is used (either HTTP or HTTPS) and the remote endpoint is served over HTTPS.

That's because the code attempts to proxy the request using a non-standard way, e.g.

POST https://somehost/api/ HTTP/1.1
...

Instead it should use the standard CONNECT method to first establish an SSL tunnel with the remote server and then send the request the usual way:

CONNECT https://somehost/ HTTP/1.1
(wait for confirmation that the tunnel has been set up)
POST /api/ HTTP/1.1
...

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling#http_tunneling for more information.

Please note that this only affects connects to an HTTPS endpoint behind a proxy. For HTTP endpoints, the current code does a proper job (in this case, using a fully qualified URL is the right way to proxy the request).

Best regards,
François

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions