Skip to content
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

midway-bin dev 模式下怎么支持ssl 自定义私钥和证书文件 #2900

Closed
Steppenwolf1900 opened this issue Apr 23, 2023 · 8 comments
Closed

Comments

@Steppenwolf1900
Copy link
Contributor

image
目前看到可以使用--ssl快速启动https服务,但是不能自己指定证书,怎么才能midway-bin dev模式下,自定义私钥和证书来启用https服务呢

@czy88840616
Copy link
Member

直接配置在 config.local 即可。https://midwayjs.org/docs/extensions/koa#https-%E9%85%8D%E7%BD%AE

@Steppenwolf1900
Copy link
Contributor Author

Serverless 项目怎么配置呢

@Steppenwolf1900
Copy link
Contributor Author

我们想在package.json中用类似midway-bin dev --ssl --https.key=./ssl/key.pem --https.cert=./ssl/cert.pem这种方式指定,目前能支持吗

@czy88840616
Copy link
Member

serverless 因为 https 都在网关,且框架侧是没有 http 服务的,所以是不做支持的。

@Steppenwolf1900
Copy link
Contributor Author

可是在开发、测试阶段我们有这样需要支持https的场景,而且现在已有midway-bin dev --ssl这种方式快速开启https服务,现在我们的需求是能自己指定证书文件,也很容易支持的,我提了一个pr #2899
看是否可以支持一下

@czy88840616
Copy link
Member

没有问题

@czy88840616
Copy link
Member

@midwayjs/[email protected]

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants