diff --git a/src/main/java/io/appium/java_client/remote/AppiumCommandExecutor.java b/src/main/java/io/appium/java_client/remote/AppiumCommandExecutor.java index 5426de95f..be8843061 100644 --- a/src/main/java/io/appium/java_client/remote/AppiumCommandExecutor.java +++ b/src/main/java/io/appium/java_client/remote/AppiumCommandExecutor.java @@ -33,7 +33,6 @@ import org.openqa.selenium.remote.http.HttpClient; import org.openqa.selenium.remote.http.HttpRequest; import org.openqa.selenium.remote.http.W3CHttpCommandCodec; -import org.openqa.selenium.remote.internal.OkHttpClient; import org.openqa.selenium.remote.service.DriverService; import java.io.IOException; @@ -70,12 +69,12 @@ public AppiumCommandExecutor(Map additionalCommands, public AppiumCommandExecutor(Map additionalCommands, URL addressOfRemoteServer) { - this(additionalCommands, addressOfRemoteServer, new OkHttpClient.Factory()); + this(additionalCommands, addressOfRemoteServer, HttpClient.Factory.createDefault()); } public AppiumCommandExecutor(Map additionalCommands, DriverService service) { - this(additionalCommands, service, new OkHttpClient.Factory()); + this(additionalCommands, service, HttpClient.Factory.createDefault()); } private B getPrivateFieldValue(String fieldName, Class fieldType) { @@ -156,4 +155,4 @@ && getCommandCodec() instanceof W3CHttpCommandCodec) { return response; } -} \ No newline at end of file +}