windows10上使用mkcert

在windows10上使用巧克力来安装mkcert
以下代码写开install.cmd中,用管理员权限运行

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install  mkcert -y

mkcert -install

安装过程中会提示,确定即可

安装完成后,就可以生成证书了


del /f /s /q *.pem 

rem  生成 
mkcert localhost.com "*.localhost.com"

以上代码,会生成一个localhost相关的证书,生成即可使用

发布了48 篇原创文章 · 获赞 36 · 访问量 34万+

猜你喜欢

转载自blog.csdn.net/qq_34924407/article/details/99707227