修复证书数据可能获取不到的问题

This commit is contained in:
GoEdgeLab
2023-04-10 09:13:05 +08:00
parent 77470d1594
commit 96dc8e4d92

View File

@@ -46,7 +46,7 @@ type SSLCertConfig struct {
// Init 校验 // Init 校验
func (this *SSLCertConfig) Init(ctx context.Context) error { func (this *SSLCertConfig) Init(ctx context.Context) error {
// 如果没有指定数据, 则从ctx中读取数据 // 如果没有指定数据, 则从ctx中读取数据
if ctx != nil && len(this.CertData) == 0 { if ctx != nil && len(this.CertData) < 128 {
var dataMapOne = ctx.Value("DataMap") var dataMapOne = ctx.Value("DataMap")
if dataMapOne != nil && !reflect.ValueOf(dataMapOne).IsNil() { if dataMapOne != nil && !reflect.ValueOf(dataMapOne).IsNil() {
dataMap, ok := dataMapOne.(*shared.DataMap) dataMap, ok := dataMapOne.(*shared.DataMap)