Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2025-05-21 09:41:53 +02:00
parent 82c177b7eb
commit ee234ea3aa
9 changed files with 34 additions and 55 deletions

View File

@ -13,7 +13,7 @@ func (p *Payload) innerHandler(ctx protocol.Context) {
ctx.EndInnerProtocol(protocol.StatusError, nil)
return
}
pl := p.Inner.Handle(ctx.ForInnerProtocol(p.Inner.Type()))
pl := p.Inner.Handle(ctx)
enc, err := pl.Encode()
if err != nil {
ctx.Log().WithError(err).Warning("failed to encode inner protocol")

View File

@ -87,15 +87,15 @@ func (p *Payload) Encode() ([]byte, error) {
func (p *Payload) Handle(ctx protocol.Context) protocol.Payload {
defer func() {
ctx.SetProtocolState(p.st)
ctx.SetProtocolState(TypeTLS, p.st)
}()
if ctx.IsProtocolStart() {
if ctx.IsProtocolStart(TypeTLS) {
p.st = NewState(ctx).(*State)
return &Payload{
Flags: FlagTLSStart,
}
}
p.st = ctx.GetProtocolState().(*State)
p.st = ctx.GetProtocolState(TypeTLS).(*State)
if p.st.TLS == nil {
p.tlsInit(ctx)