mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 09:02:42 +08:00
fix: 解决导入 cloudflare 证书域名显示错误的问题 (#1268)
Refs https://github.com/1Panel-dev/1Panel/issues/1184
This commit is contained in:
parent
921e886e71
commit
08992f83b5
3 changed files with 5 additions and 15 deletions
|
@ -682,20 +682,11 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH
|
|||
websiteSSL.StartDate = cert.NotBefore
|
||||
websiteSSL.Type = cert.Issuer.CommonName
|
||||
websiteSSL.Organization = cert.Issuer.Organization[0]
|
||||
websiteSSL.PrimaryDomain = cert.Subject.CommonName
|
||||
if len(cert.Subject.Names) > 0 {
|
||||
var domains []string
|
||||
for _, name := range cert.Subject.Names {
|
||||
if v, ok := name.Value.(string); ok {
|
||||
if v != cert.Subject.CommonName {
|
||||
domains = append(domains, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(domains) > 0 {
|
||||
websiteSSL.Domains = strings.Join(domains, "")
|
||||
}
|
||||
if len(cert.DNSNames) > 0 {
|
||||
websiteSSL.PrimaryDomain = cert.DNSNames[0]
|
||||
websiteSSL.Domains = strings.Join(cert.DNSNames, ",")
|
||||
}
|
||||
|
||||
websiteSSL.Provider = constant.Manual
|
||||
websiteSSL.PrivateKey = req.PrivateKey
|
||||
websiteSSL.Pem = req.Certificate
|
||||
|
|
|
@ -5,7 +5,6 @@ ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AE
|
|||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_reject_handshake on;
|
||||
add_header Strict-Transport-Security "max-age=31536000";
|
||||
error_page 497 https://$host$request_uri;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
:label="$t('website.brand')"
|
||||
fix
|
||||
show-overflow-tooltip
|
||||
prop="type"
|
||||
prop="organization"
|
||||
></el-table-column>
|
||||
<el-table-column :label="$t('ssl.autoRenew')" fix>
|
||||
<template #default="{ row }">
|
||||
|
|
Loading…
Reference in a new issue