mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
fix: fixed a bug in the https.proxy certificates cache due to a race condition which caused the same certificate to be generated more than once
This commit is contained in:
parent
e19595395f
commit
e3573b81e4
2 changed files with 9 additions and 9 deletions
|
@ -211,7 +211,7 @@ func (p *HTTPProxy) TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *
|
|||
|
||||
cert := getCachedCert(hostname, port)
|
||||
if cert == nil {
|
||||
p.Debug("creating spoofed certificate for %s:%d", tui.Yellow(hostname), port)
|
||||
p.Info("creating spoofed certificate for %s:%d", tui.Yellow(hostname), port)
|
||||
cert, err = btls.SignCertificateForHost(ca, hostname, port)
|
||||
if err != nil {
|
||||
p.Warning("cannot sign host certificate with provided CA: %s", err)
|
||||
|
@ -219,6 +219,8 @@ func (p *HTTPProxy) TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *
|
|||
}
|
||||
|
||||
setCachedCert(hostname, port, cert)
|
||||
} else {
|
||||
p.Debug("serving spoofed certificate for %s:%d", tui.Yellow(hostname), port)
|
||||
}
|
||||
|
||||
config := tls.Config{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue