From 034a58207823def56d4adf4384bf4a901e87b29b Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 26 Jun 2024 14:57:55 +0200 Subject: [PATCH] [java] Setting proxy in SM only when it is needed. Fixes #14162 --- java/src/org/openqa/selenium/remote/service/DriverFinder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/src/org/openqa/selenium/remote/service/DriverFinder.java b/java/src/org/openqa/selenium/remote/service/DriverFinder.java index de9a911b983c7..7216b5d9783d1 100644 --- a/java/src/org/openqa/selenium/remote/service/DriverFinder.java +++ b/java/src/org/openqa/selenium/remote/service/DriverFinder.java @@ -148,7 +148,9 @@ private List toArguments() { } Proxy proxy = Proxy.extractFrom(options); - if (proxy != null) { + if (proxy != null + && proxy.getProxyType() != Proxy.ProxyType.DIRECT + && proxy.getProxyType() != Proxy.ProxyType.AUTODETECT) { arguments.add("--proxy"); if (proxy.getSslProxy() != null) { arguments.add(proxy.getSslProxy());