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

[bug] An insecure WebSocket connection may not be initiated from a page loaded over HTTPS #7651

Closed
trookie2000 opened this issue Aug 18, 2023 · 2 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@trookie2000
Copy link

Describe the bug

Mixed Content: The page at 'https://tauri.localhost/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://192.168.2.171:8080/conn/d7c52c9d3dfe44638a75aacbf7a0b08e'. This request has been blocked; this endpoint must be available over WSS.

Reproduction

No response

Expected behavior

No response

Platform and versions

Environment
› OS: Windows 10.0.19044 X64
› Webview2: 104.0.1293.63
› MSVC:
- Visual Studio ���ɹ��� 2022
› Node.js: 16.15.1
› npm: 8.15.1
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.62.1
› cargo: 1.62.1
› Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
› @tauri-apps/cli [NPM]: 1.0.5
› @tauri-apps/api [NPM]: 1.0.2
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,

App
› build-type: bundle
› CSP: default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
› distDir: ../dist
› devPath: http://localhost:5173
› framework: Vue.js

App directory structure
├─ .vscode
├─ dist
├─ node_modules
├─ public
├─ src
└─ src-tauri

Stack trace

Mixed Content: The page at 'https://tauri.localhost/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://192.168.2.171:8080/conn/d7c52c9d3dfe44638a75aacbf7a0b08e'. This request has been blocked; this endpoint must be available over WSS.

DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Additional context

No response

@trookie2000 trookie2000 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Aug 18, 2023
@FabianLars
Copy link
Member

Hi 👋 This is a duplicate of #3007. That issue also mentions a few workarounds if you can't make your websocket server use ssl. The most important workarounds are the websocket plugin, which can connect to non-secure servers just fine, and the localhost plugin which makes your frontend run on http://localhost (also exposing your frontend to the whole user system).
I'm also working on a better solution here #7645 - i hope i can get it into 1.5 but no promises.

@Zhuinden
Copy link

Interestingly, you might just need to enable insecure content in your browser to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants