-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Client network socket disconnected before secure TLS connection was established #6482
Comments
Hey @alexlee-dev, to make sure I have this right:
Is that correct? |
You can set headers with cy.visit: cy.visit({
url: 'http://google.com',
headers: {
'some-header': 'foo'
}
}) |
@flotwig Thanks for the quick response :)
I'm thinking that somewhere a websocket is closed too quickly in-between hitting URL#1, the endpoint of URL#2 and changing the window location to URL#3. I would set a header, but I'm not sure which one would satisfy the socket closing error. |
Does your application in step (2) create a websocket, or are you referring to the websocket that Cypress creates & uses internally? Is the new URL on step (2) on the same domain as the URL from step (1)? Maybe you could give me some pseudo-URLs to try. You could try sending |
I believe it's just a simple post request to a REST server. I don't explicitly see any websocket created by the application. My inclination to think it's a websocket issue comes from that being the error message displayed when reading the debug logs in the cypress terminal. Yes, the URL on step 2 is on the same domain as the URL from step 1. However, I believe the server is making a request to an outside domain before sending back the response (not sure if that is relevant though). URL#1 (My Domain) -> Returns React Application -> React App Hits URL#2 (My Domain) -> Server listens for request to URL#2 and makes request to Service (Not My Domain) -> Server sends back response to React App -> React App uses React Router to redirect to a new page (My Domain). I can try and do the same logic as above with a dummy server in a repo if you'd like. |
Yeah, that would be super helpful, then I can reproduce the issue and try to debug it. Thanks! |
@flotwig I've created a repo so you can reproduce the issue. Steps for installing and running the servers are in the README at the root. Let me know if you have any questions! Thanks. https://github.com/alexlee-dev/cypress-issue-6482 It works without a proxy. It fails with a proxy.
|
@flotwig Any progress on this one? Or any direction toward debugging I could be going towards? I understand you guys are busy though. Thanks! |
@alexlee-dev are you using some kind of development proxy? I tried testing your project, it works for me both with and without a proxy. I used https://github.com/cypress-io/debugging-proxy to stand up a proxy locally, and ran |
It's some annoying corp proxy that I don't have much control over or insight into unfortunately :( What does |
Since my proxy is on localhost, that tells requests to still use the proxy, even for requests that go over localhost. Or else the debugging proxy would have no effect. |
This could be due to missing proxy auth. In mycase I missed protocol and basic auth of the HTTP_PROXY, hence it could be this: HTTP_PROXY=http://<user>:<pass>@<host>:<port> Furthermore as I requested HTTPS it was the HTTPS_PROXY that needed to be set. Feedback: it would be nice with more details on the TLS connection error - i.e. "missing auth".. |
@flotwig , @CarstenHS -- Ok, so I did a lot more digging. It turns out it had something to do with a weird setup on the particular server that was in the development environment I was using. I ended up having a coworker configure a different server and now it's working without an error. I'll close this for now, as I'm convinced it's my workplace's config and not Cypress itself. Thank you for the help and sorry for the trouble. |
Current behavior:
Attempt to
cy.visit()
a url behind a corp proxy (successfully configured, as I can visit other websites through Cypress through the proxy), that quickly redirects to another site. I believe it opens and closes a websocket very quickly, and this is causing Cypress (or one of it's dependencies) to throw an error.No network request is even logged in the console. In the debug logs, this request and error can be seen as Cypress retries the same request over and over again until timeout.
Desired behavior:
Visit the site and allow for this socket hangup to occur.
Test code to reproduce
Very difficult to give you something to reproduce here - would need a corp proxy, proxy setup, dns, and a server to redirect. I understand if this is not helpful, but I was hoping this has been seen before.
Versions
Cypress v4.0.1
Windows 10
Error seen in Chrome, FireFox, and Electron
Seems very similar to #2295 and possibly #4764
If I don't have access to the server itself, is there a way I can set a header for the connection within Cypress?
I've also tried setting up a middle server to redirect to the real server and telling Cypress to hit the middle server, but getting the same results.
The text was updated successfully, but these errors were encountered: