ews-javascript-api
ews-javascript-api copied to clipboard
Yet another "Client network socket disconnected before secure TLS connection was established".
trafficstars
Exchange 2013 (yes, in 2022) NTLM-enabled server, no basic auth, no 0auth.
There HAS to be something I'm missing here:
// self-signed certificate
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0
let EWS = require ("ews-javascript-api");
EWS.EwsLogging.DebugLogEnabled = true;
// I need NTLM, but WHICH ONE? None seem to work
const { XhrApi, ntlmAuthXhrApi } = require ("@ewsjs/xhr");
EWS.ConfigurationApi.SetXHROptions({rejectUnauthorized : false});
let xhr = new XhrApi()
xhr.useNtlmAuthentication(cr.username, cr.password);
EWS.ConfigurationApi.ConfigureXHR(xhr);
var service = await new EWS.ExchangeService(EWS.ExchangeVersion.Exchange2013);
service.Credentials = new EWS.WebCredentials("fake", "fake");
service.Url = await new EWS.Uri(cr.url);
and then I do (in an async func, ofc)
console.log(await service.GetUserOofSettings(cr.username))
I can clearly see, that the NTLM kicks in, but fails mid-negotiation.
I'm 100% sure the server's fine, since I'm able to connect via cURL and get the data with the XML generated by this lib. Any help?
does cURL work with NTLM? Also what kind of reverse proxy you have in front?
Yes, cURL works NTLM as expected. No proxy.