-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing SSL Cert/Key when using HTTPS #1226
Comments
You should be able to specify these options in https://github.com/vuejs/vue-cli/blob/dev/docs/config.md So just that I understand:
|
You are right! I actually didn't know I could override it there, but it makes sense. I could argue these should be CLI arguments as well. I think those were my expectations having worked with other similar CLIs. Seeing This is fine though. You can close this if you feel that overriding via config is sufficient. |
It works via config. I don't think this is necessary anymore. Thanks for pointing it out! |
I'm trying to do exactly this, and added the stuff called for to vue.config.js:
and I still get an invalid SSL cert (unrecognzied CA) when I run Using @vue/cli-service 3.4.1 |
OK - never mind. I figured out what was wrong. Passing --https to vue-cli-service serve appears to OVERRWRITE the https element of devServer (probably with true). That's a bit of guesswork/inference, but what is clear, is that eliminating the --https parameter to vue-cli-service serve fixed my problem, and caused vue-cli-serve to properly use the provided certs. |
I am not able to import the fs module. It is throwing an error My vue.config.js looks like this. Please help
|
Hm sorry to bump this but webpack document suggests : module.exports = {
//...
devServer: {
https: true,
key: fs.readFileSync('/path/to/server.key'),
cert: fs.readFileSync('/path/to/server.crt'),
ca: fs.readFileSync('/path/to/ca.pem'),
}
}; |
What problem does this feature solve?
Allows users to utilize custom SSL certs for HTTPS.
In some cases, it might be necessary to use an SSL certificate for local development.
Moreover, these options are accepted for both webpack-dev-server and the newer webpack-serve:
I think it makes sense to expose these options to users.
Other CLIs have accepted similar PRs:
What does the proposed API look like?
The addition of
--key
,--cert
and potentially--cacert
tovue-cli-service serve
.These values would be optional when
--https
is used, but in order to use--key
and--cert
,--https
would be required. Or we could infer--https
from the presence of a cert/key.The text was updated successfully, but these errors were encountered: