-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
cy.visit() results in ERR_SSL_VERSION_OR_CIPHER_MISMATCH #771
Comments
@jennifer-shehane , I believe I am having this same issue. If you don't think this is related, I can open a new issue. I am using Cypress It doesn't matter if I set describe('Should allow Chrome Extension to be injected', function() {
beforeEach(function(){
cy.visit('https://github.com/willklein/github-markdown-menu');
});
it('.should() - do something', function () {
expect(true).to.equal(false);
});
}); Instead of getting the expected assertion failure, Cypress tells me that there isn't any tests to run (after it tries to visit the url) But if I change the URL to a domain that doesn't require https, then the test fails as expected: describe('Should allow Chrome Extension to be injected', function() {
beforeEach(function(){
cy.visit('http://mrdoob.com');
});
it('.should() - find the extension', function () {
expect(true).to.equal(false);
});
}); |
@radiovisual the issue you're having is not related to the one that @jennifer-shehane opened. Additionally, your issue has nothing to do with https as well. Https works just fine in Cypress. A quick test with The problem that you're showing is that Github has security mechanisms in place that defeat the automation capabilities of Cypress. This has been documented and talked about on here many many times. When you visit Github these security features are redirecting Cypress. The code looks as simple as this: if (window.top !== window.self) {
window.location.back()
} However, this problem is simple to work around. You shouldn't be testing sites that you don't control. Test your own applications - and if your own applications have these security mechanisms then you should disable them while in testing environment. |
Here's a much more comprehensive answer that I've given for this exact scenario: |
Thanks @brian-mann, I only put that test code up there as an example, but I do understand the importance of only testing apps that are under your control, I was trying to prepare a simpler test case to demonstrate the problem in #876, but then when it wouldn't run my simple use case, I ran into a problem that felt a lot like this issue, but yes, now I see that they are different. Anyway, thanks for the input. 👍 |
I have made a small repo with a docker image that will setup apache with a self signed ssl cert that shows this error. https://github.com/bskrtich/cypress-ssl-mismatch Let me know if you have any questions. |
@bskrtich oh thank you. this should be enough to figure it out. |
Does anyone have a workaround for this? |
@radiovisual Some updates to frame-busting changes we're making can be read here: #886 |
This issue still exists in 2.0.0. It's a show stopper for us. |
I did some additional digging into what causes this issue, and it appears that this is triggered specifically by using Inspired by @bskrtich's example, I have created joshdk/cypress-ssl-repro as a minimal repro with documentation. Additionally, I had some observations while testing:
I hope that this helps folks resolve the issue!
|
@joshdk This is great! I forked your repo and added the cypress tests so we can get it up and running more quickly. In
|
I am also having this problem:
Seems that it is not a big problem, because switching from https://127.0.0.1 to http://127.0.0.1 fixes it. Do I have to worry? There should not be any differences between https/http in app behavior, am I correct? |
@anurbol the correct workaround for now iirc is switching |
@joshsleeper Thanks for reply and your opinion 👍 I got https worked by using vhosts (https://myhost.lc instead of https://127.0.0.1). |
I'm having this problem as well and am stuck.
Would love to push this tool at my org, but need some kind of solution or workaround... |
@silversteez try setting your |
@brian-mann Happy to report that that worked! I added |
@brian-mann In my opinion you can for sure close this issue, because solution is known and confirmed working: P.S. I wanted to contribute to docs (https://docs.cypress.io/guides/references/error-messages.html#Browser-Errors) but my lack of english and contributing skills would not let me do that without worsening docs quality :) but maybe @jennifer-shehane may help |
@anurbol |
@joshsleeper Yours is definitely more responsible and correct way of dealing with issues, I agree. However it seems that it is not an issue of cypress, but rather of chrome, because manually opening website in chrome with https protocol and self-signed certs and ip as host gives you the same error. Therefore I doubted cypress team can do anything with this. That just what I was thinking, but you definitely have more experience, sorry for my probably monkey-patching-ish proposal :-) |
@anurbol If you're correct (which I'm thinking you might very well be) and it's truly a Chrome issue, it seems like the correct behavior from Cypress' side is to either:
Currently, the way things fail there's no hint of any kind as to who's problem it is, which was the main frustration here. Coping with browser limitations/bugs like this is A-OK, but it'd be much nicer to know what the actual issue is and how to work around it without having to chase down github issues. ;) Again, sorry for coming off like a punk, I didn't mean any harm. Just strong willed about eager-closing of issues is all! |
@joshsleeper :) that's a good points and principles, thanks for sharing them! Also, I don't mind for that kind of "harsh" as long as is it's on point, it saves time and reduces reading and that's important :-) |
I am experiencing this issue when connecting to a local web server via IP that has a self-signed certificate. I'm happy to say, the workaround suggested by @brian-mann worked for me. I didn't pick up on it when skimming through this earlier, so here are the steps for Windows:
cy.visit('some.website.com'); And you should be good to go! 😃 |
It is actually on us (Cypress responsibility) to correctly handle ip addresses that are using a self signed cert. We don't, and that's why this error propagates out. The workaround is assigning a virtual host to it due to the way we handle SNI, but we should be able to also handle the ip address. |
@brian-mann ..the workaround is working locally i.e. by mapping DNS to ip in /etc/hosts but when using docker + circleCi , can u pls tell how to map inside a container run by CI to manage /etc/hosts.. |
I am beginner. Try to access IP address. Getting error This site can't provide a secure connection How I can handle this error |
Not sure for this . But I kinda used the workaround mentioned in the trailing msgs . u can try that out. |
I tried all solution mentioned in trailing msgs. |
I mapped the DNS for the VM in the /etc/hosts in mac and it worked both locally and in docker |
I don't have permission to mapped the DNS. Is other option |
I mapped DNS now I am getting |
The error generally comes when node.js canot find the server from DNS . We u map the DNS , did u use the same dns to refer to the IP ? |
The code for this is done in cypress-io/cypress#4947, but has yet to be released. |
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. We also ensure all shared libraries this version of Cypress uses are installed in the test environment. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. We also ensure all shared libraries this version of Cypress uses are installed in the test environment. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. We also ensure all shared libraries this version of Cypress uses are installed in the test environment. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. We also ensure all shared libraries this version of Cypress uses are installed in the test environment. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
Released in |
Is this a Feature or Bug?
Bug
Current behavior:
In some circumstances, users encounter this error when visiting their application:
If you encounter this bug, please try to paste any test code or information you can below as we have been unable to reproduce this issue.
Theory
The problem is likely the way the user's server is self signing the cert and it is confusing the Cypress proxy, which ultimately confuses the browser.
The text was updated successfully, but these errors were encountered: