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?]: "official" HTTPs support #1546

Closed
2 tasks done
slainless opened this issue Jun 16, 2024 · 2 comments
Closed
2 tasks done

[Bug?]: "official" HTTPs support #1546

slainless opened this issue Jun 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@slainless
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Well, I don't know if this falls into feature request category or bug so forgive me if I'm using the wrong type of issue.

Just like #139 , all we really know is how to configure https with pure Vite environment. Sadly, Vite's server.https doesn't work with current/latest solid start setup. While it's possible to mitigate or work around this using reverse proxy, IMHO, It's more preferable if official framework support this, just like when working in Vite.

Is there a way to configure local development server to use HTTPs? If not, will local HTTPs feature be implemented/supported in the future?

Thanks.

Expected behavior 🤔

A working dev server using secured HTTP

Steps to reproduce 🕹

Steps if following vite https recommendation:

  1. Install basic ssl plugin such as @vite/plugin-basic-ssl or vite-plugin-mkcert
  2. Setup the plugin
  3. Access dev with https protocol
  4. Browser show ssl error/misconfigured ssl

Context 🔦

I'm trying to develop/use feature which are strictly blocked by server when using non-secure context (for example, Worker).

Your environment 🌎

- OS: Windows
- Browser: Chrome
- @solid/start: v1.0.0
- vinxi: 0.3.11
@slainless slainless added the bug Something isn't working label Jun 16, 2024
@Brendonovich
Copy link
Contributor

Here's a solution I posted in discord

import { defineConfig } from "@solidjs/start/config";
import mkcert from "vite-plugin-mkcert";

export default defineConfig({
  ssr: true,
  vite: {
    server: { https: true },
    plugins: [
      mkcert({
        force: true,
        savePath: "./certs",
      }),
    ],
  },
//  run once with this commented out, then leave it uncommented all other times
//  server: {
//    https: {
//      cert: "./certs/cert.pem",
//      key: "./certs/dev.pem",
//    },
//  },
});

@slainless
Copy link
Author

@Brendonovich Ah thanks, didn't know that it's already supported in vinxi instead.

But well, in my defense, vinxi server.https is currently untyped and I just realized I already look at nksaraf/vinxi#307 but I don't even bother reading the issue content, thinking its unrelated, I'm so dumb 💀.

Anyway, thanks for your help, both here and there :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants