diff --git a/proxy/addon.go b/proxy/addon.go index ddde001..d10e055 100644 --- a/proxy/addon.go +++ b/proxy/addon.go @@ -19,6 +19,9 @@ type Addon interface { // A server connection has been closed (either by us or the server). ServerDisconnected(*ConnContext) + // The TLS handshake with the server has been completed successfully. + TlsEstablishedServer(*ConnContext) + // HTTP request headers were successfully read. At this point, the body is empty. Requestheaders(*Flow) @@ -40,6 +43,8 @@ func (addon *BaseAddon) ClientDisconnected(*ClientConn) {} func (addon *BaseAddon) ServerConnected(*ConnContext) {} func (addon *BaseAddon) ServerDisconnected(*ConnContext) {} +func (addon *BaseAddon) TlsEstablishedServer(*ConnContext) {} + func (addon *BaseAddon) Requestheaders(*Flow) {} func (addon *BaseAddon) Request(*Flow) {} func (addon *BaseAddon) Responseheaders(*Flow) {} diff --git a/proxy/interceptor.go b/proxy/interceptor.go index 5044f79..2e95f2d 100644 --- a/proxy/interceptor.go +++ b/proxy/interceptor.go @@ -125,6 +125,11 @@ func newMiddle(proxy *Proxy) (interceptor, error) { if err := connCtx.tlsHandshake(clientHello); err != nil { return nil, err } + + for _, addon := range connCtx.proxy.Addons { + addon.TlsEstablishedServer(connCtx) + } + return ca.GetCert(clientHello.ServerName) }, },