eomeroff
eomeroff

Reputation: 9915

Unable to call EWS when require ssl is true

I have Exchange server 2010 installed in development environment. I am trying to call EWS services form node js web application which is also in dev environment.

When i set require ssl on EWS web site on IIS manager, I get 403 error. Which it normal because my URL endpoint in application was with http, exactly: http://192.168.50.192/EWS/Exchange.asmx

But when I try with url https://192.168.50.192/EWS/Exchange.asmx that is https, I am getting timeout.

I am entering this url on web form and then programmatically compose SOAP request which I sent to this URL.

I have tried to start ngrok and use whole application with https locally, but I get the same result.

If ssl certificate is the issue, ngrok has valid certificate.

Please advise.

Do I need to apply any additional settings on IIS?

Upvotes: 1

Views: 1376

Answers (2)

Gautam Singh
Gautam Singh

Reputation: 1138

You can try two things:

  1. generate SSL certificate in the host name/fqdn (exchserver/exch.domain.com) format rather than with IP address. import this ssl certificate and chain using Exchange Admin Center/IIS. Also trust this certificate in your client computer where you are running the nodejs application.
  2. instruct nodejs to ignore server certificate by putting this line before all your codes process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; taken from Ignore invalid self-signed ssl certificate in node.js with https.request?

if you are working on EWS extensively in your nodejs app you should consider using ews-javascript-api node module

Upvotes: 0

Mehdi Karamosly
Mehdi Karamosly

Reputation: 5438

Could you inspect the error details, or do you have a log that you can check ?

By reading the issues, there at least two things that could lead to the issue, if your applications are not sharing the same domain you could be having an issue with the same domain policy and for that you may fix it with CORS policy.

if the issue is not related to SSL certificate, your issue may be related to CORS policy (How to allow CORS? , https://senecacd.wordpress.com/2013/02/15/enabling-cors-on-a-node-js-server-same-origin-policy-issue/)

if that is related to SSL then you need to create a self signed SSL Certificate and try with it. (you need to disable the SSL peer validation though.)

Upvotes: 2

Related Questions