1 Star 0 Fork 0

oppo/bettercap

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
http_proxy_cert_cache.go 555 Bytes
一键复制 编辑 原始数据 按行查看 历史
evilsocket 提交于 2018-01-24 20:51 +08:00 . balls
package modules
import (
"crypto/tls"
"fmt"
"sync"
)
var (
certCache = make(map[string]*tls.Certificate)
certLock = &sync.Mutex{}
)
func getCachedCert(domain string, port int) *tls.Certificate {
key := fmt.Sprintf("%s:%d", domain, port)
certLock.Lock()
defer certLock.Unlock()
if cert, found := certCache[key]; found == true {
return cert
}
return nil
}
func setCachedCert(domain string, port int, cert *tls.Certificate) {
key := fmt.Sprintf("%s:%d", domain, port)
certLock.Lock()
defer certLock.Unlock()
certCache[key] = cert
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lmdy/bettercap.git
git@gitee.com:lmdy/bettercap.git
lmdy
bettercap
bettercap
v2.3.1

搜索帮助