Skip to content

[🐛 Bug]: Selenium Manager 4.52.0 writes rustls log to stderr, breaking JSON parsing in Java ("Failed to parse json output") #18263

Closed

Description

@asolntsev

Description

Since Selenium 4.52.0, Selenium Manager prints a log line from the rustls_platform_verifier crate to stderr whenever TLS certificate validation fails:

[2026-10-29T19:43:16Z ERROR rustls_platform_verifier::verification::apple] failed to verify TLS certificate: invalid peer certificate: Other(OtherError("“*.badssl.com” certificate is not trusted: -67843"))

The Java binding runs Selenium Manager via ExternalProcess, which merges stderr into stdout (builder.redirectErrorStream(true)). The stray line ends up in front of the JSON, and SeleniumManager.getBinaryPaths() fails with Failed to parse json output.

This happens even when Selenium Manager itself recovers. In our case it fell back to the cached driver and returned "code": 0 with a valid driver_path, but the session still can't be created.

Real-world scenario: we start the browser with a MITM proxy (BrowserUp/LittleProxy) set in ChromeOptions.setProxy(). DriverFinder passes that proxy to Selenium Manager as --proxy, so Selenium Manager's own requests to googlechromelabs.github.io go through the MITM proxy and see its self-signed certificate. With 4.51.0 this worked; with 4.52.0 every session fails to start.

Expected: in --output json mode, nothing but JSON should be written to stdout/stderr (the crate's log output should be routed into the JSON logs array or suppressed), or the Java binding should not merge stderr into the parsed output.

Reproducible Code

Standalone, without any proxy (self-signed.badssl.com stands in for a MITM proxy certificate):

~/.cache/selenium/manager/4.52.0/selenium-manager --browser chrome --driver-version 140 \
  --driver-mirror-url https://self-signed.badssl.com/ --output json \
  > out.txt 2> err.txt
cat err.txt
# [2026-10-29T19:43:16Z ERROR rustls_platform_verifier::verification::apple] failed to verify TLS certificate: ...

With 4.51.0, the same command leaves err.txt empty.

From Java: any new ChromeDriver(options) where options.setProxy(...) points to a MITM proxy whose CA isn't in the system trust store.

Debugging Logs

org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: chromedriver, error Failed to parse json output, executed "/Users/andrei/.cache/selenium/manager/4.52.0/selenium-manager" with arguments [--browser, chrome, --proxy, 10.171.1.143:54290, --language-binding, java, --output, json]
[2026-10-29T19:35:26Z ERROR rustls_platform_verifier::verification::apple] failed to verify TLS certificate: invalid peer certificate: Other(OtherError("“LittleProxy MITM” certificate is not trusted: -67843"))
{
  "logs": [
    {
      "level": "WARN",
      "timestamp": 1793302526,
      "message": "There was an error managing chromedriver (error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json): client error (Connect): invalid peer certificate: Other(OtherError(\"“LittleProxy MITM” certificate is not trusted: -67843\")). TLS certificate validation failed. If a proxy or mirror on your network uses its own certificate authority, add it to the system trust store (on Linux, SSL_CERT_FILE can point to a CA bundle)); using driver found in the cache"
    },
    ...
  ],
  "result": {
    "code": 0,
    "message": "",
    "driver_path": "/Users/andrei/.cache/selenium/chromedriver/mac-arm64/156.0.8078.47/chromedriver",
    "browser_path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
  }
}
Caused by: org.openqa.selenium.json.JsonException: Expected to read a START_MAP but instead have: START_COLLECTION.
	at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:124)
	at org.openqa.selenium.remote.service.DriverFinder.getDriverPath(DriverFinder.java:55)
	at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:107)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:93)

Operating System / Binding / Browser

macOS (arm64), Java 17, Chrome. Found in the Selenide proxy integration tests.

Activity

  1. added
    C-java
    I-defect
    C-rust
    on Oct 29, 2026
  2. nvborisenko commented on Oct 29, 2026

    @nvborisenko
    Member

    @asolntsev workaround is #18222
    But yes, seems --output json should always produce messages in correct format.

  3. nvborisenko commented on Oct 29, 2026

    @nvborisenko
    Member

    I remember @titusfortner raised ticket to simplify output processing by SM #17748. And this is very good.

  4. added a commit that references this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaC-rustI-defect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions