mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
197cff7108
commit
7234323840
1 changed files with 4 additions and 4 deletions
|
@ -277,7 +277,7 @@ func (p *HTTPProxy) httpsWorker() error {
|
||||||
for p.isRunning {
|
for p.isRunning {
|
||||||
c, err := p.sniListener.Accept()
|
c, err := p.sniListener.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warning("Error accepting connection: %s.", err)
|
log.Warning("error accepting connection: %s.", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,17 +288,17 @@ func (p *HTTPProxy) httpsWorker() error {
|
||||||
|
|
||||||
tlsConn, err := vhost.TLS(c)
|
tlsConn, err := vhost.TLS(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warning("Error reading SNI: %s.", err)
|
log.Warning("error reading SNI: %s.", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hostname := tlsConn.Host()
|
hostname := tlsConn.Host()
|
||||||
if hostname == "" {
|
if hostname == "" {
|
||||||
log.Warning("Client does not support SNI.")
|
log.Warning("client does not support SNI.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug("Got new SNI from %s for %s", core.Bold(stripPort(c.RemoteAddr().String())), core.Yellow(hostname))
|
log.Debug("[%s] proxying connection from %s to %s", core.Green("https.proxy"), core.Bold(stripPort(c.RemoteAddr().String())), core.Yellow(hostname))
|
||||||
|
|
||||||
req := &http.Request{
|
req := &http.Request{
|
||||||
Method: "CONNECT",
|
Method: "CONNECT",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue