Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[bug] Allow self signed certs for backend validation #2894

Closed
m2-assistant bot opened this issue Dec 4, 2020 · 2 comments · Fixed by #2891
Closed

[bug] Allow self signed certs for backend validation #2894

m2-assistant bot opened this issue Dec 4, 2020 · 2 comments · Fixed by #2891
Assignees

Comments

@m2-assistant
Copy link

m2-assistant bot commented Dec 4, 2020

This issue is automatically created based on existing pull request: #2891: Allow self signed certs for backend validation


Description

Fixes an issue with using self signed certs (valet secure) and the new sample backend validator.

If you use a local backend with some self signed cert, it fails to validate:

~/code/pwa-studio develop
λ node
Welcome to Node.js v14.15.1.
Type ".help" for more information.
> const fetch = require('node-fetch');
undefined
> fetch('https://latest.test')
Promise { <pending> }
> (node:64113) UnhandledPromiseRejectionWarning: FetchError: request to https://latest.test/ failed, reason: unable to verify the first certificate
    at ClientRequest.<anonymous> (/Users/stephen/code/pwa-studio/node_modules/node-fetch/lib/index.js:1444:11)
    at ClientRequest.emit (events.js:315:20)
    at ClientRequest.EventEmitter.emit (domain.js:486:12)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)
    at TLSSocket.EventEmitter.emit (domain.js:486:12)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:64113) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:64113) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Related Issue

Closes #ISSUE_NUMBER.

Acceptance

Verification Stakeholders

Specification

Verification Steps

  1. Check out PR.
  2. Switch your backend to a local instance secured and served via valet+.
  3. Run yarn. It should work on this PR, but not on develop.

Screenshots / Screen Captures (if appropriate)

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.
@sirugh sirugh changed the title [Issue] Allow self signed certs for backend validation [bug] Allow self signed certs for backend validation Dec 4, 2020
@sirugh
Copy link
Contributor

sirugh commented Dec 4, 2020

@magento export issue to Jira project PWA as Story

@magento-engcom-team
Copy link

✅ Jira issue (https://jira.corp.magento.com/browse/PWA-1182) is successfully created for this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants