Skip to content

Cant confirm cert on custom host with dev domain #17

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

Open
grindpride opened this issue Mar 27, 2023 · 3 comments
Open

Cant confirm cert on custom host with dev domain #17

grindpride opened this issue Mar 27, 2023 · 3 comments

Comments

@grindpride
Copy link

grindpride commented Mar 27, 2023

OS: Windows 11

vite --https --host any-custom-host.dev --port 443 --mode multi --strictPort

vite.config.ts

export default defineConfig({
  server: { https: true },
  plugins: [vue(), basicSsl()],
  preview: {
    https: true
  }
})

there is no cert confirm button in chrome and firefox

host with ru domain works well

vite-plugin-mkcert works well with .dev domain

@grindpride grindpride changed the title Cant confirm cert on local url with dev domain Cant confirm cert on custom host with dev domain Mar 27, 2023
@bluwy

This comment has been minimized.

@bluwy
Copy link
Member

bluwy commented Feb 26, 2025

Actually this is indeed about the .dev domain specifically as browsers have different hardcoded handling for it, but I'm not sure what we need to do to fix it.

@sapphi-red
Copy link
Member

sapphi-red commented Mar 3, 2025

.dev is included in the HSTS preload list (chromium's one) and it seems browsers require a certificate trusted by the machine for those domains.
https://stackoverflow.com/a/49505444

mkcert works because it installs a local CA to the machine, which will make the self-signed cert "trusted". This means you (and your browser) will "trust" any certs created by that local CA. This requires you to keep the local CA key safe (or delete it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants