mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
fix(client-certificates): use matching origin for connections on :443 (#31913)
Motivation: When using client-certificates on a website on port `443`, we would normalise the user input with `new URL` but still generate a "bad" representation of the "origin" internally, since the just do concatenated "host:port". (The origin doesn't contain the port in case of :443) We use `clientCertificatesToTLSOptions` in two places: a) for APIRequestContext, there we pass one from the URL constructor over and b) from the socks proxy, there we **now** also pass a "good one" over. Test plan: We don't want to run the tests on port :443, so only manually validated the fix. Relates https://github.com/microsoft/playwright/issues/31906
This commit is contained in:
parent
44ce6096bb
commit
bd186640df
@ -148,7 +148,7 @@ class SocksProxyConnection {
|
||||
port: this.port,
|
||||
rejectUnauthorized: !this.socksProxy.ignoreHTTPSErrors,
|
||||
ALPNProtocols: [internalTLS.alpnProtocol || 'http/1.1'],
|
||||
...clientCertificatesToTLSOptions(this.socksProxy.clientCertificates, `https://${this.host}:${this.port}`),
|
||||
...clientCertificatesToTLSOptions(this.socksProxy.clientCertificates, new URL(`https://${this.host}:${this.port}`).origin),
|
||||
};
|
||||
if (!net.isIP(this.host))
|
||||
tlsOptions.servername = this.host;
|
||||
|
Loading…
Reference in New Issue
Block a user