HTTPs

1. 安裝 Chocolatey

1.1 CMD

1.2 檢查

复制代码
choco -version

2. 安裝 MKCERT

复制代码
choco install mkcert

default install path

3. 頒布證書

3.1 檢查 mkcert 命令

复制代码
Get-command 檢查window的命令

> Get-Command mkcert

Powershell 中

复制代码
mkcert localhost 127.0.0.1 192.168.1.167 weberp.abc.com abc.com

4. Vue3 配置

443是Https default 端口,與Http 80 類似。

复制代码
  server: {
    https: {
      key: fs.readFileSync(path.resolve(__dirname, 'cert/localhost+3-key.pem')),
      cert: fs.readFileSync(path.resolve(__dirname, 'cert/localhost+3.pem'))
    },

    open: true,
    port: 443,
    host: '0.0.0.0',
    cors: true,
相关推荐
Lsetea14 小时前
OpenSSL读取加密私钥报bad decrypt:passin与口令来源排查
linux·https·ssl证书·openssl·私钥
Lsetea16 小时前
OpenSSL报CA signature digest algorithm too weak:error 68与签名摘要排查
https·ssl证书·openssl·签名算法·证书链
Lsetea1 天前
curl报91 No OCSP response received:cert-status与OCSP装订排查
https·ssl证书·openssl·curl·ocsp
Lsetea1 天前
OpenSSL报self-signed certificate in certificate chain:error 19与信任根排查
https·ssl证书·openssl·curl·证书链
zxanz12 天前
网站为什么需要 SSL 证书来实现 https?
https
Lsetea2 天前
curl报58 unable to set private key file:客户端证书与私钥加载排查
运维·https·ssl证书·openssl·curl
Lsetea2 天前
OpenSSL报certificate is not yet valid:error 9与notBefore时间排查
linux·运维·https·ssl证书·openssl
2501_915909062 天前
iOS应用从开发到上架App Store的完整发布流程与步骤指南
android·ios·小程序·https·uni-app·webview
Smoothcloud润云3 天前
GPU服务器租用实例DNS与HTTPS下载排障实战
大数据·运维·服务器·人工智能·https·gpu算力