1. 程式人生 > 實用技巧 >Windows環境下vscode Live Server外掛如何開啟https

Windows環境下vscode Live Server外掛如何開啟https

0x01vscode http外掛 Live Server如何開啟https

在本機端的開發環境下,如果要測試一些需要HTTPS的功能可以使用mkcert給自己頒發憑證

0x02 安裝步驟如下:

1、安裝 mkcert

安裝環境:Windows 7+ / Windows Server 2003+

1)以管理員身份執行powershell

2)執行命令: Get-ExecutionPolicy,如果系統返回 Restricted,則在執行命令:Set-ExecutionPolicy AllSigned ,選擇 A(全是)

3)執行命令:

Set-ExecutionPolicy Bypass -Scope Process
-Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

4)等待數秒,安裝完成

5)執行choco -?驗證是否安裝成功

具體詳細安裝方法見:https://chocolatey.org/install

安裝完成後,執行命令choco install mkcert

,等待安裝完成。

2、安裝本地CA

將本地CA 加入系統的信任清單內:

執行命令 mkcert -install

顯示下面結果,安裝完成

Created a new local CA at "C:\Users\**\AppData\Local\mkcert"