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

This commit is contained in:
刘祥超
2023-04-10 09:13:05 +08:00
parent 1f7e60d062
commit 753552d4a4

View File

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