ews-javascript-api icon indicating copy to clipboard operation
ews-javascript-api copied to clipboard

Yet another "Client network socket disconnected before secure TLS connection was established".

Open 4aiman opened this issue 3 years ago • 2 comments
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?

4aiman avatar Jul 27 '22 22:07 4aiman

does cURL work with NTLM? Also what kind of reverse proxy you have in front?

gautamsi avatar Jul 28 '22 21:07 gautamsi

Yes, cURL works NTLM as expected. No proxy.

4aiman avatar Jul 29 '22 11:07 4aiman