我想通过SSL提供我的应用程序,之前我有这个脚本:
ng serve --ssl --ssl-key "pathtokey\key.crt"
我想在新的angular.json中添加SSL,但是当我尝试添加时,出现了错误:
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(ssl).
如何在Angular CLI 6中正确使用SSL?
我想通过SSL提供我的应用程序,之前我有这个脚本:
ng serve --ssl --ssl-key "pathtokey\key.crt"
我想在新的angular.json中添加SSL,但是当我尝试添加时,出现了错误:
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(ssl).
如何在Angular CLI 6中正确使用SSL?
在 angular.json 文件中:
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build",
"ssl": true,
"sslKey": "path to .key",
"sslCert": "path to .crt"
},
...
}
Angular 6要求你定义参数:--ssl-key & --ssl-cert
创建或获取已信任的证书密钥和证书文件,并将其放置在C:\ certificates \中
ng serve --ssl --ssl-key c:\\certificates\\server.key --ssl-cert c:\\certificates\\server.crt