mhewedy / ews

Go package wrapper for Exchange Web Service (EWS). Supports NTLM and more! Used in mego https://github.com/mhewedy/mego
Other
42 stars 27 forks source link

HTTP_1_1_REQUIRED #3

Closed sbabiv closed 4 years ago

sbabiv commented 4 years ago

NTLM: true err: Post https://mail.domain.ru/ews/Services.wsdl: stream error: stream ID 3; HTTP_1_1_REQUIRED

mhewedy commented 4 years ago

sorry for the late response, I just noticed the issue...

I am trying to duplicate the issue, but it seems this domain is not accessible (I tried 2 internet providers).

Can you provide the IP address of the domain so I can investigate the issue?

sbabiv commented 4 years ago

I am connecting to a server (ms exchange 2016 CU15) on the local network Looks like a problem with go-ntlmssp The problem is solved by setting GODEBUG = http2client = 0 # disable HTTP / 2 client support go version go1.13.1 darwin / amd64

https://golang.org/pkg/net/http/

ntlm authorization works using http1.1 protocol

mhewedy commented 4 years ago

Thanks for the update

sbabiv commented 4 years ago

This code solves the problem TLSNextProto: map[string]func(authority string, c *tls.Conn) http.RoundTripper{},

&http.Client{
            Timeout: timeout,
            Transport: ntlmssp.Negotiator{
                RoundTripper: &http.Transport{
                    TLSNextProto: map[string]func(authority string, c *tls.Conn) http.RoundTripper{},
                },
            },