1 Star 0 Fork 0

KingFane/mgate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
verifier.go 669 Bytes
一键复制 编辑 原始数据 按行查看 历史
digitwin 提交于 2025-02-28 11:47 +08:00 . initial
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package verifier
import "crypto/x509"
type Verifier interface {
// VerifyPeerCertificate is used to verify certificates in TLS config.
VerifyPeerCertificate(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error
}
type Validator func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error
func NewValidator(verifiers []Verifier) Validator {
return func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
for _, vm := range verifiers {
if err := vm.VerifyPeerCertificate(rawCerts, verifiedChains); err != nil {
return err
}
}
return nil
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kingfane/mgate.git
git@gitee.com:kingfane/mgate.git
kingfane
mgate
mgate
v0.0.1

搜索帮助