Vite Certificate
I just ran into problem while creating certificate for localhost, using vite I changed app.config.js the code below is my configuration
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: "./cert",
}),
],
},
server: {
https: {
cert: "./cert/cert.pem",
key: "./cert/dev.pem"
},
},
})
I expect it to create valid certificate but browsers warn that its certificate is not valid.1 Reply
In the past I installed:
npm install -D @vitejs/plugin-basic-ssl
Then you can import this: import basicSsl from '@vitejs/plugin-basic-ssl'
And use it like this: