Skip to content

nodejs 18: digital envelope routines::unsupported #422

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

Closed
nxps opened this issue May 12, 2023 · 5 comments
Closed

nodejs 18: digital envelope routines::unsupported #422

nxps opened this issue May 12, 2023 · 5 comments

Comments

@nxps
Copy link

nxps commented May 12, 2023

Node.js v18.16.0
ews-javascript-api v0.12.0
@ewsjs/xhr v1.5.0

(async () => {
  const xhr = new XhrApi().useNtlmAuthentication(credentials.userName, credentials.password);
  ews.ConfigurationApi.ConfigureXHR(xhr);
  
  const service = new ews.ExchangeService(ews.ExchangeVersion.Exchange2016);
  service.Credentials = new ews.WebCredentials(credentials.userName, credentials.password);
  service.Url = new ews.Uri(credentials.url);
  service.AcceptGzipEncoding = false;

  const emailMessage = new ews.EmailMessage(service);
  emailMessage.ToRecipients.Add(mail);
  emailMessage.Subject = 'Email sent with EWS API';

  const messageBody = new ews.MessageBody();
  messageBody.BodyType = ews.BodyType.HTML;
  messageBody.Text = 'Test email sent using EWS API';
  emailMessage.Body = messageBody;
  try {
    await emailMessage.SendAndSaveCopy();
    console.log('success');
  } catch (error) {
    console.log(error);
  }
})()

error log:

SoapFaultDetails {
  message: 'error:0308010C:digital envelope routines::unsupported',
  InnerException: null,
  faultCode: null,
  faultString: null,
  faultActor: null,
  responseCode: 127,
  errorCode: 0,
  exceptionType: null,
  lineNumber: 0,
  positionWithinLine: 0,
  errorDetails: DictionaryWithStringKey {
    keys: [],
    keysToObjs: {},
    objects: {},
    keyPicker: [Function (anonymous)]
  },
  HttpStatusCode: undefined
}
@gautamsi
Copy link
Owner

see this - https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

you may be able to use it with legacy ssl provider, I am not sure if i can fix the ntlm-client lib easily, any help is welcome

@tomer953
Copy link

Hi,
I'm having trouble as well with ews and ntlm auth.
I guess this is related, right?
ewsjs/xhr#13
ewsjs/ntlm-client#2

@guicara
Copy link

guicara commented Aug 11, 2023

Hello,

I have the same issue after upgrading my project to Node 18 (previously Node 16).

Using NODE_OPTIONS=--openssl-legacy-provider, as explained in the Stack Overflow page linked by @gautamsi, fixed my issue.

@bfredo123
Copy link

Same here, I have to use Node 18+ for other packages, and I could see that creating a 'md4' hash triggers this error (even without ews-javascript-api). So any upgrade to git rid of this 'md4' hash in ews-javascript-api and ewsjs/whr will be more than welcome! Thank you, and thank you again for these great packages which help me a lot!

@gautamsi
Copy link
Owner

have updated to 0.14 which should fix this issue (ccd9d30)

NODE_OPTIONS=--openssl-legacy-provider` should have been the workaround as I tested today.

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

5 participants