37 Commits

Author SHA1 Message Date
Dmitry Gozman
669cdcce3e
chore: refactor some code around proxies (#35572) 2025-04-10 12:59:52 +01:00
Dmitry Gozman
a6d5c981af
Revert "feat: support proxy in connect/connectOverCDP (#35389)" (#35542) 2025-04-08 21:10:38 +01:00
Dmitry Gozman
471a28e0d5
feat: support proxy in connect/connectOverCDP (#35389) 2025-03-28 12:03:54 +00:00
Max Schmitt
3584e72223
chore: remove 'as *' imports because of esModuleInterop: true (#34854) 2025-02-19 15:32:12 +01:00
Pavel Feldman
3d760b657b
chore: move debug, env and user agent from utils/ (#34766) 2025-02-12 19:27:24 -08:00
Pavel Feldman
bd74fc4964
chore: move utils that are user in server to server/utils (2) (#34736) 2025-02-11 17:19:27 -08:00
Pavel Feldman
4a7f6a6ef0
chore: organize imports in playwright-core (#34680) 2025-02-07 13:54:01 -08:00
Dmitry Gozman
7d8265e610
Revert "Reapply "fix(har timing): record connect timing for proxied connections" (#32855) (#33003)" (#34535) 2025-01-29 14:51:31 +00:00
Adam Gastineau
875436855e
chore(lint): Ensure EOL newlines (#34117) 2024-12-20 09:17:09 -08:00
Simon Knott
042161e1ce
Reapply "fix(har timing): record connect timing for proxied connections" (#32855) (#33003)
This reapplies what we reverted in
https://github.com/microsoft/playwright/pull/32989.

Max and me debugged this, and found that the test failures come from
SOCKS proxy now preferring IPv6 over IPv4. We've updated the tests and
made sure that this doesn't mask any breaking change.

I'm enabling CQ1 to make sure we don't oversee any other CI failures.
2024-10-08 14:17:50 +02:00
Simon Knott
1b589c4bd3
Revert "fix(har timing): record connect timing for proxied connections" (#32989)
Reverts microsoft/playwright#32855. This broke two tests on main, and we
don't yet know how to fix it other than downgrading.
2024-10-08 10:13:21 +02:00
Simon Knott
de4a4d1ce1
fix(har timing): record connect timing for proxied connections (#32855)
Fixes a bug discovered in
https://github.com/microsoft/playwright/pull/32647. When using http
proxy, the `connect` event isn't emitted so we don't populate
`tcpConnectionAt`. The updated version of `https-proxy-agent` emits a
`proxyConnect` as a replacement, so this PR updates and listens to that
event.
For socks proxies, the `on("socket")` event is emitted once the SOCKS
connection is established, which is the equivalent of having a TCP
connection available.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-10-07 09:59:13 +02:00
Max Schmitt
48030a4eff
test: fix test expecations after Node.js 22.9.0 (#32695) 2024-09-19 10:52:29 +02:00
Max Schmitt
21d162c945
feat(client-certificates): add support for proxies (#32611)
Fixes https://github.com/microsoft/playwright/issues/32370
2024-09-16 17:57:33 +02:00
Max Schmitt
79cba7d704
chore: introduce option overrides on context/browser (#32606) 2024-09-13 17:34:34 +02:00
Max Schmitt
16e76cb71a
fix(client-certificates): errors during http2 TLS handshake (#32258) 2024-08-22 15:13:54 +02:00
Max Schmitt
faf4853259
chore: validate client-certificates on context creation (#32168) 2024-08-19 09:02:14 +02:00
Max Schmitt
743565ee3e
chore: generate self-signed certificates for socks proxy (#32192) 2024-08-16 20:21:05 +02:00
Max Schmitt
a1d32d997c
fix(client-certificates): improve close handling from target and proxy (#32158) 2024-08-15 10:21:10 +02:00
Max Schmitt
aac3a84321
fix(client-certificates): stall on tls handshake errors (#32163)
Extracted from https://github.com/microsoft/playwright/pull/32158.
2024-08-15 08:51:40 +02:00
Max Schmitt
4daf5c2303
fix(client-certificates): when server does tls renegotiation (#32155)
Certain https servers like Microsoft IIS aka. TLS servers do the TLS
renegotiation after the TLS handshake. This ends up in two
`'secureConnect'` events due to an upstream Node.js bug:
https://github.com/nodejs/node/issues/54362

Drive-by: Move other listeners like `'close'` / `'end'` to `once()` as
well.

Relates https://github.com/microsoft/playwright/issues/32004
2024-08-14 15:11:29 +02:00
Max Schmitt
613ccb8d5b
chore(client-certificates): rewrite error for unsupported PFX errors (#32008) 2024-08-05 14:42:29 +02:00
Max Schmitt
71e614dc5a
fix(client-certificates): report error to the browser if incorrect passphrase (#32007) 2024-08-05 10:54:33 +02:00
Max Schmitt
f17de8222f
chore: run client-certificate tests in service mode (#31973) 2024-08-02 08:34:28 +02:00
Max Schmitt
bd186640df
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
2024-07-30 12:23:57 +02:00
Max Schmitt
cc313f3290
fix(client-certificates): error response body Content-Length calculation (#31897) 2024-07-29 14:39:14 +02:00
Max Schmitt
09581b615d
fix(client-certificates): return target errors on response when using http2 (#31867) 2024-07-26 11:28:45 +02:00
Max Schmitt
a02ed38e60
chore: reduce file reads in client-certificates internal TLS server (#31865) 2024-07-25 22:36:25 +02:00
Max Schmitt
0c6ecf8df4
chore: use happy eyeballs for client-certificates (#31859) 2024-07-25 18:55:47 +02:00
Max Schmitt
7570c25b3d
chore: remove glob from client-certificate matching (#31846)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-07-24 19:13:03 +02:00
Max Schmitt
c5b7ce86dc
feat(client-certificates): add http2 support (#31786) 2024-07-24 11:39:39 +02:00
Max Schmitt
c4862c022c
chore: client certificates api review (#31826) 2024-07-23 22:56:36 +02:00
Max Schmitt
b9c4b6bff0
chore: client certificates refactorings (#31822) 2024-07-23 19:18:31 +02:00
Max Schmitt
526e4118fa
chore: use socks.Duplex constructor instead of extending (#31816) 2024-07-23 15:44:16 +02:00
Max Schmitt
f104e920e0
fix(client-certificates): pass TLS servername for SNI (#31761) 2024-07-19 12:55:20 +02:00
Max Schmitt
708def8804
fix(client-certificates): keep ignoreHTTPSErrors false by default (#31760) 2024-07-18 22:37:11 +02:00
Max Schmitt
9569cb5c1e
feat: support client certificates (#31529)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-07-12 11:42:24 +02:00