I have this "Rebex.Net.EwsException exception: unexpected HTTP response" while logging
I've try different authentication method, different SSL Mode. The TLS Handshake looks Ok.
what am I doing wrong?
Thank you
Detailed log:
FileLogWriter(8)[11] Info: Assembly: Rebex.Common 2020 R4 for .NET 4.0-4.8
FileLogWriter(8)[11] Info: Platform: Windows 10.0.14393 64-bit; CLR: 4.0.30319.42000
FileLogWriter(8)[11] Info: Culture: fr; Windows-1252
EWS: Executing Connect method.
EWS: Connecting to https://mail.xXxXxXxX.fr:443 using Ews.
Info: Assembly: Rebex.Ews 2020 R4 for .NET 4.0-4.8
Info: Platform: Windows 10.0.14393 64-bit; CLR: 4.0.30319.42000
Info: Culture: fr; Windows-1252
HTTP: Connecting to 'https://mail.xXxXxXxX.fr:443'...
Info: Assembly: Rebex.Networking 2020 R4 for .NET 4.0-4.8
Info: Platform: Windows 10.0.14393 64-bit; CLR: 4.0.30319.42000
Info: Culture: fr; Windows-1252
Proxy: Resolving 'mail.xXxXxXxX.fr'.
Proxy: Connecting to xx.xx.xx.xx:443 (no proxy).
Proxy: Connection established.
TLS: Using classic TLS core.
TLS: Enabled cipher suites: 0x000F3DF7EBE00640.
TLS: Applicable cipher suites: 0x000F3DF7EBE00640.
TLS: HandshakeMessage:ClientHello was sent.
TLS: HandshakeMessage:ServerHello was received.
TLS: Negotiating TLS 1.2, RSA with ephemeral ECDH, AES with 128-bit key in GCM mode, AEAD.
TLS: The server supports secure renegotiation.
TLS: HandshakeMessage:Certificate was received.
TLS: HandshakeMessage:ServerKeyExchange was received.
TLS: HandshakeMessage:ServerHelloDone was received.
TLS: Verifying server certificate ('CN=mail.xXxXxXxX.fr, O=xxxx., L=PARIS, S=Île-de-France, C=FR').
TLS: Certificate verification result: Accept
TLS: Verifying server key exchange signature.
TLS: Using ephemeral ECDH public key exchange with NIST P-256 curve.
TLS: HandshakeMessage:ClientKeyExchange was sent.
TLS: CipherSpec:ChangeCipherSpec was sent.
TLS: HandshakeMessage:Finished was sent.
TLS: CipherSpec:ChangeCipherSpec was received.
TLS: HandshakeMessage:Finished was received.
TLS: Connection secured using cipher: TLS 1.2, RSA with ephemeral ECDH, AES with 128-bit key in GCM mode, AEAD.
HTTP: Sending request: HEAD /EWS/Services.wsdl
HTTP: PreAuthenticate: False
HTTP: Request Connection: keep-alive.
HTTP: Sending request (124 bytes).
HTTP: Received response: 401 Unauthorized.
HTTP: Received 14 headers.
HTTP: Response Content-Length: 0 bytes.
HTTP: Response Connection not specified; using 'keep-alive'.
HTTP: Response Content-Encoding not specified.
HTTP: Server requires authentication: Basic realm="mail.xXxXxXxX.fr"
HTTP: Server requires authentication: Negotiate
HTTP: Server requires authentication: NTLM
EWS: Server supports OAuth 2.0: True
EWS: Connect succeeded.
EWS: Executing Login method.
EWS: Authenticating to Exchange server as 'mail@server.fr'.
EWS: Executing GetFolderId method.
HTTP: Sending request: POST /EWS/Exchange.asmx
HTTP: PreAuthenticate: False
HTTP: Request Connection: keep-alive.
HTTP: Sending request (270 bytes).
HTTP: Sending 581 bytes of data.
HTTP: Received response: 401 Unauthorized.
HTTP: Received 11 headers.
HTTP: Response Content-Length: 0 bytes.
HTTP: Response Connection not specified; using 'keep-alive'.
HTTP: Response Content-Encoding not specified.
HTTP: Response Transfer-Encoding not specified.
HTTP: Server requires authentication: Basic realm="mail.xXxXxXxX.fr"
HTTP: Server requires authentication: Negotiate
HTTP: Server requires authentication: NTLM
HTTP: Discarding pending response data...
HTTP: Received content (0 bytes).
HTTP: Closing response stream.
HTTP: Attempting 'Negotiate' authentication.
HTTP: Authentication message: Negotiate TlRMTVNTUAABAAAAl4II4
HTTP: Sending request: POST /EWS/Exchange.asmx
HTTP: PreAuthenticate: False
HTTP: Request Connection: keep-alive.
HTTP: Sending request (353 bytes).
HTTP: Sending 581 bytes of data.
HTTP: Received response: 401 Unauthorized.
HTTP: Received 11 headers.
HTTP: Response Content-Length: 0 bytes.
HTTP: Response Connection not specified; using 'keep-alive'.
HTTP: Response Content-Encoding not specified.
HTTP: Response Transfer-Encoding not specified.
HTTP: Server requires authentication: Negotiate TlRMTVNTUAACAAAAE
HTTP: Server requires authentication: Basic realm="mail.xXxXxXxX.fr"
HTTP: Server requires authentication: NTLM
HTTP: Authentication challenge: TlRMTVNTUAACA
HTTP: Discarding pending response data...
HTTP: Received content (0 bytes).
HTTP: Closing response stream.
HTTP: Authentication message: Negotiate TlRMTVNTUAADAAAAG
HTTP: Sending request: POST /EWS/Exchange.asmx
HTTP: PreAuthenticate: False
HTTP: Request Connection: keep-alive.
HTTP: Sending request (1005 bytes).
HTTP: Sending 581 bytes of data.
HTTP: Received response: 400 Bad Request.
HTTP: Received 12 headers.
HTTP: Response Content-Length: 48 bytes.
HTTP: Response Connection not specified; using 'keep-alive'.
HTTP: Response Content-Encoding not specified.
HTTP: Response Transfer-Encoding not specified.
HTTP: Request failed: 400 Bad Request
EWS: GetFolderId failed: Rebex.Net.EwsException: Unexpected HTTP response. ---> hqclv.vhucl: 400 Bad Request
--- End of inner exception stack trace ---
at hqclv.sfreo.jpyxt[T](String p0, Object p1)
at Rebex.Net.Ews.dahop(EwsFolderId p0, iveiz p1)
at Rebex.Net.Ews.hqclv.refiw.rusqy()
at Rebex.Net.Ews.sofql[T](String p0, Func`1 p1, rllcm p2)
2021-10-20 11:09:39.285 DEBUG Ews(316)[11] HTTP: Closing HTTP session (310).
2021-10-20 11:09:39.285 DEBUG Ews(316)[11] TLS: Closing TLS socket.
2021-10-20 11:09:39.286 DEBUG Ews(316)[11] TLS: Alert:CloseNotify was sent.