Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4aiman opened this issue Jul 27, 2022 · 2 comments

Comments

@4aiman
Copy link

4aiman commented Jul 27, 2022

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?

@gautamsi
Copy link
Owner

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

@4aiman
Copy link
Author

4aiman commented Jul 29, 2022

Yes, cURL works NTLM as expected.
No proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants