cypress: cy.visit secure error when _ used in hostname
Current behavior:
When I try to visit my app, which located in JenkinsCI, I encounter an error:
This site can’t provide a secure connection someadresss.tk doesn't adhere to security standards.
ERR_SSL_SERVER_CERT_BAD_FORMAT

When I put URL in the browser app open, this error only in Cypress sandbox
Versions
Operating System: Ubuntu 16.04 Cypress Version: 3.1.3 Browser Version: Chrome 70
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 18 (3 by maintainers)
We also have same issue with wildcard certificate, issued by Letsencrypt, when we try to run tests against subdomain.
After researches, found out, that underscore
_in subdomain name produced this error with Electron browser. Switching to subdomain with hyphen-instead, fixed issue.@alexbridge Thanks so much for leaving a comment!
This does appear to be the root of the issue. I believe this is a legitimate error due to
_being used in the hostname, which is invalid as described in RFC 952I just wanna say that the
_was the issue for my problem. After hours, I found this simple solution in here. So, the URL was adapted and now I can move on. Thanks 😃The RFC has a preferred name syntax outlined here.
Additionally SSL certs are no longer issued to subdomains with underscores for this exact reason. See this link.
It’s clearly strongly recommended to not use underscores in subdomains, but it is not uniformly enforced across browsers.
We haven’t personally spent time to look into why this is not working, but would be open to a pull request that allows URLs with underscores to display as they would in a normal browser.
Example test
@AshrafShaik001 Yes, we changed the name of the host (fortunately, the developer address only).