[Question]: How can i connect to browser running on a Moon cluster over secure websocket connection
See original GitHub issueYour question
I am trying to connect to browser running on a Moon cluster over secure websocket connection as documented and i am getting the following exception "PlaywrightException: WebSocket error: unable to verify the first certificate"
full trace:
Unhandled exception. Microsoft.Playwright.PlaywrightException: WebSocket error: unable to verify the first certificate
=========================== logs ===========================
<ws connecting> wss://moon.perci.dev.local/playwright/chromium/playwright-1.22.0
<ws error> [object Object]
<ws connect error> wss://moon.perci.dev.local/playwright/chromium/playwright-1.22.0 unable to verify the first certificate
<ws disconnected> wss://moon.perci.dev.local/playwright/chromium/playwright-1.22.0 code=1006 reason=
============================================================
at Microsoft.Playwright.Transport.Connection.InnerSendMessageToServerAsync[T](String guid, String method, Object args) in /_/src/Playwright/Transport/Connection.cs:line 164
at Microsoft.Playwright.Transport.Connection.WrapApiCallAsync[T](Func`1 action, Boolean isInternal)
at Microsoft.Playwright.Core.BrowserType.ConnectAsync(String wsEndpoint, BrowserTypeConnectOptions options) in /_/src/Playwright/Core/BrowserType.cs:line 150
at TestMoon.TestMoon.Main() in C:\Users\69935\code\TestMoon\TestMoon\Program.cs:line 10
at TestMoon.TestMoon.<Main>()
Process finished with exit code -532,462,766.
It is failing here :
await using var browser = await playwright.Chromium.ConnectAsync("wss://moon.test.local/playwright/chromium/playwright-1.22.0");
The sertificates as stored in Local and User Certificate manager.
any suggestions?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Moon - A cross browser Selenium, Cypress, Playwright and ...
A Selenium, Cypress, Playwright and Puppeteer testing platform running in Kubernetes or Openshift clusters. Fully compatible with Selenium Webdriver ...
Read more >How to secure your WebSocket connections - freeCodeCamp
#5: Use SSL over websockets This is a no-brainer, but still needs to be said. Use wss:// instead of ws://. This adds a...
Read more >The WebSocket API (WebSockets) - Web APIs - MDN Web Docs
desktop desktop
Chrome Edge
WebSocket Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
WebSocket() constructor Full support. Chrome4. Toggle history Full support. Edge12. Toggl...
Read more >WebSockets and Node.js - testing WS and SockJS by building ...
Node.js can maintain many hundreds of WebSockets connections simultaneously. ... work with WS on the server and the browser's WebSocket API on the...
Read more >26. WebSocket Support - Spring
On the browser side, applications can use the sockjs-client (version 1.0.x) that emulates the W3C WebSocket API and communicates with the server to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That error should be resolved by setting
NODE_EXTRA_CA_CERTS
to point to your cert.Let me know if that works for you. In my repro, I was hitting the same error as you above, and setting
NODE_EXTRA_CA_CERTS
to point at mycert.pem
resolved it.I consider this suggestion a workaround since it leaks Node.js implementation details up to .NET (and in an ideal world we’d automatically pick it up from your OSes trust store assuming it’s been added).
@rwoll Thanks again! It works!