selenium-webdriverselenium-chromedriveropenjdk-17

JDK 17 ERR_SSL_PROTOCOL_ERROR with Chrome and Selenium


When I ran Selenium tests using selenium/standalone-chrome:97.0 I am getting the following error with JDK 17.

org.openqa.selenium.WebDriverException: unknown error: net::ERR_SSL_PROTOCOL_ERROR

I am accessing the web app with a hostname (not localhost). When I tried with JDK 16 with the same configuration I didn't get the error.

Appreciate it if anyone has any insight into this. Was there some SSL change introduced in JDK17 that causes this issue?


Solution

  • The root cause of this issue was I was using a hostname with an underscore (_). I suspect due to some changes, hostnames with underscore not supported in JDK17 (This worked fine with JDK16).

    Caused by: java.lang.IllegalArgumentException: The encoded server name value is invalid
            at javax.net.ssl.SNIHostName.<init>(SNIHostName.java:179) ~[?:?]
            at sun.security.ssl.ServerNameExtension$CHServerNamesSpec.<init>(ServerNameExtension.java:131) ~[?:?]
            ... 30 more
    Caused by: java.lang.IllegalArgumentException: Contains non-LDH ASCII characters
            at java.net.IDN.toASCIIInternal(IDN.java:297) ~[?:?]
            at java.net.IDN.toASCII(IDN.java:123) ~[?:?]
            at javax.net.ssl.SNIHostName.<init>(SNIHostName.java:175) ~[?:?]
            at sun.security.ssl.ServerNameExtension$CHServerNamesSpec.<init>(ServerNameExtension.java:131) ~[?:?]
            ... 30 more