Skip to content

SIGSEGV with ERR_TLS_REQUIRED_SERVER_NAME in Server.addContext #9220

@bahmutov

Description

@bahmutov
The Test Runner unexpectedly exited via a exit event with signal SIGSEGV

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Platform: darwin (19.5.0)
Cypress Version: 5.6.0
GET /__cypress/tests?p=cypress/support/index.js 200 1268.985 ms - -
Error [ERR_TLS_REQUIRED_SERVER_NAME] [ERR_TLS_REQUIRED_SERVER_NAME]: "servername" is required parameter for Server.addContext
    at Server.addContext (_tls_wrap.js:1400:11)
    at /Users/gleb/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/https-proxy/lib/server.js:222:23
    at tryCatcher (/Users/gleb/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/https-proxy/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/gleb/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/https-proxy/node_modules/bluebird/js/release/promise.js:512:31)

Relevant code from packages/https-proxy/lib/server.js

  _getPortFor (hostname) {
    return this._getCertificatePathsFor(hostname)
    .catch((err) => {
      return this._generateMissingCertificates(hostname)
    }).then((data = {}) => {
      if (net.isIP(hostname)) {
        return this._getServerPortForIp(hostname, data)
      }

      this._sniServer.addContext(hostname, data) // line 222

      return this._sniPort
    })
  }

Reproduction steps:

What is happening I think: the test tries to include a script pointing at external CDN https: //cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js in the iframe, which seems to crash badly.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions