Skip to content
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

MSW fails bypassing to remote server using self-signed SSL certificate #1652

Open
4 tasks done
mfrieling opened this issue Jul 4, 2023 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser

Comments

@mfrieling
Copy link

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 14 or higher

Browsers

Chromium (Chrome, Brave, etc.)

Reproduction repository

not possible, read reproduction steps

Reproduction steps

I theoretically could provide a reproduction repository, but I cannot provide a server with a self-signed and therefore insecure SSL certificate which is not localhost.

  • Setup an empty worker (no handlers needed)
  • Start the worker in a app (in my case it's Angular but can be React, Vue or whatever) with { onUnhandledRequest: 'bypass' }
  • In the app execute a request to an external server which uses a self-signed SSL certificate which is considered insecure by the browser. Because MSW doesn't have a matching handler it should bypass and execute.

Current behavior

As long as I haven't opened the insecure url in the same browser and used the advanced option "Proceed to [domain] (unsafe)" the request should fail with an informative error message, without as well as with MSW enabled.

Without MSW, after I've clicked "Proceed (unsafe)", the request is executed correctly.

With MSW, after I've clicked "Proceed (unsafe)", MSW fails to execute the request producing the following log output:
image
(Blurred url parts contain customer and product names, but basically that is a docker instance running the backend on a specific branch via CI. That url is internal/behind a VPN.)

Expected behavior

✅ Without MSW, after I've clicked "Proceed (unsafe)", the request is executed correctly.
❌ With MSW, after I've clicked "Proceed (unsafe)", the request is executed correctly.

@mfrieling mfrieling added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser labels Jul 4, 2023
@H0JLuk
Copy link

H0JLuk commented Apr 3, 2024

i have the same behavior when use my system certificate for API, but with another log in console:
The FetchEvent for "https://ci04770618-web.apps.dev-gen1-ds.delta.sbrf.ru/web/auth/user/" resulted in a network error response: the promise was rejected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:browser Related to MSW running in a browser
Projects
None yet
Development

No branches or pull requests

2 participants