Skip to content

startLogcatBroadcast does not respect https #2181

@janmekota

Description

@janmekota

Description

Bug.
The Appium is accessible over HTTPS.

curl https://<user>:<pass>@<host>:8443/status
{"value":{"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.1.3"}}}

The tests are triggered with java property -Dappium.hub=https://user:pass@host:8443.

When we call startLogcatBroadcast:
androidDriver.startLogcatBroadcast(androidDriver.getRemoteAddress().getHost(), androidDriver.getRemoteAddress().getPort());
We get error:

org.openqa.selenium.remote.http.ConnectionFailedException: JdkWebSocket initial request execution error
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.5', java.version: '17.0.7'
Driver info: driver.version: unknown
Caused by: java.net.http.WebSocketHandshakeException
Caused by: jdk.internal.net.http.websocket.CheckFailedException: Unexpected HTTP response status code 404
	... 11 more
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
org.openqa.selenium.remote.http.jdk.JdkHttpClient.openSocket(JdkHttpClient.java:240)
io.appium.java_client.ws.StringWebSocketClient.connect(StringWebSocketClient.java:74)
io.appium.java_client.android.ListensToLogcatMessages.startLogcatBroadcast(ListensToLogcatMessages.java:67)

URI: http://host:8443/ws/session/b515a27e-ff21-4e43-b8f2-b336eed55665/appium/device/logcat

Here the endpointUri is set to ws:// regardless -Dappium.hub=https://. The wss:// should be used.

Environment

  • Java client build version: java-client-9.2.3.jar
  • Appium server version: 2.1.3
  • OS version used to run Appium: Ubuntu 18.04.3 LTS
  • Node.js version: v16.20.2
  • Mobile platform/version under test: Android
  • Real device: moto-e40 (Android 11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions