tauri-apps / tauri-apps/tauri

[bug] Self Signed Certificate Hosting https `devUrl`

Open
#12,331 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage type: bug
Dominant language
Rust
Stars
111k
Forks
4k
Avg merge
2d 7h
Merged PRs (30d)
45

Description

Describe the bug

We are building a password manager of sorts and have the requirement of using (subtle) WebCrytpo in our app. My understanding is that the only way the browser is able to access WebCrypto is by being in a secure context (ie. ssl) environment.

I can run my dev server locally with a self signed certificate (from mkcert) and it works no issue across all browsers. When I configure the devUrl in tauri to use https: I receive an error along the lines:
image

If I remove the ssl from both my dev server and tauri devUrl it works across all browsers an emulators.

Does tauri support https: devUrl's? If not, is there an other way to enable the secure context so that we can leverage (subtle) WebCrypto?

Reproduction

No response

Expected behavior

I should be able to specify an https: devUrl and it should work.

Full tauri info output
[✔] Environment
    - OS: Mac OS 15.1.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.11.0
    - yarn: 4.5.3
    - npm: 10.9.0

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.2.2

[-] Plugins
    - tauri-plugin-log 🦀: 2.0.2
    - @tauri-apps/plugin-log : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../out
    - devUrl: https://localhost:5030/
    - framework: React (Next.js)
    - bundler: Webpack

[-] iOS
    - Developer Teams: None
Stack trace

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Tauri handles the configured https://localhost:5030/ devUrl and how the Wry webview treats the mkcert self-signed certificate. Compare the behavior with the working browser setup, then determine whether the devUrl can support this certificate and verify that the app provides the secure context needed by WebCrypto.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, rust, webpack
Domain
desktop, security, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.