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

增加证书相关功能 #226

Merged
merged 8 commits into from
Apr 17, 2023
Merged

增加证书相关功能 #226

merged 8 commits into from
Apr 17, 2023

Conversation

wsczx
Copy link
Contributor

@wsczx wsczx commented Mar 31, 2023

  • 新增支持自定义上传证书功能
  • 新增支持申请和自动续期Let's Encrypt证书(暂只支持阿里云和腾讯云)功能
  • 新增支持动态加载证书(更换证书不需重启)功能

* 新增支持申请和自动续期Let's Encrypt证书(暂只支持阿里云和腾讯云)功能
* 新增支持动态加载证书(更换证书不需重启)功能
@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2023

Codecov Report

Patch coverage has no change and project coverage change: -1.38 ⚠️

Comparison is base (df52087) 20.54% compared to head (19e99b7) 19.16%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #226      +/-   ##
==========================================
- Coverage   20.54%   19.16%   -1.38%     
==========================================
  Files          61       63       +2     
  Lines        3812     4086     +274     
==========================================
  Hits          783      783              
- Misses       2907     3181     +274     
  Partials      122      122              
Impacted Files Coverage Δ
server/admin/api_cert.go 0.00% <0.00%> (ø)
server/admin/server.go 0.00% <0.00%> (ø)
server/dbdata/cert.go 0.00% <0.00%> (ø)
server/dbdata/db.go 6.00% <0.00%> (-2.00%) ⬇️
server/dbdata/setting.go 0.00% <ø> (ø)
server/handler/server.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -48,6 +48,13 @@ func startTls() {
NextProtos: []string{"http/1.1"},
MinVersion: tls.VersionTLS12,
CipherSuites: selectedCipherSuites,
GetCertificate: func(*tls.ClientHelloInfo) (*tls.Certificate, error) {
cert, err := tls.LoadX509KeyPair(base.Cfg.CertFile, base.Cfg.CertKey)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方,性能不会会比较差

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实会有一些影响,但是可以保证实时动态加载证书,或者用一个定时器来定期读取证书文件?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你可以保存在变量,更新证书的时候,顺便更新一下这个变量

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,谢谢大佬,我改一下

@bjdgyc bjdgyc merged commit 8798de0 into bjdgyc:dev Apr 17, 2023
@monlor
Copy link

monlor commented Oct 19, 2023

现在证书有三个地方都可以配置,server.toml配置文件,ui上传证书,ui配置Let's Encrypt,那实际生效的证书是优先取哪一个呢?

@wsczx
Copy link
Contributor Author

wsczx commented Oct 20, 2023

没有优先级,上传和Let's Encrypt会覆盖配置文件里面设置的证书文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants