From ad8f2bae8ba50a0c9986bfe6c77503b6adba04ee Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sun, 22 Oct 2023 00:04:08 -0500 Subject: [PATCH] may not come with stream header So keep reading until we see the stream features before we decide starttls won't be one of them. --- starttls.go | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/starttls.go b/starttls.go index e3205b9..d930916 100644 --- a/starttls.go +++ b/starttls.go @@ -53,17 +53,23 @@ func DoXMPP(tlsconfig *tls.Config, daneconfig *Config) (*tls.Conn, error) { writer.WriteString(outstring) writer.Flush() - // read response stream header; look for STARTTLS feature support - _, err = reader.Read(buf) - if err != nil { - return nil, err - } - line = string(buf) - transcript += fmt.Sprintf("recv: %s\n", line) gotSTARTTLS := false - if strings.Contains(line, "