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

SSL key #9

Open
zbessler opened this issue Dec 11, 2014 · 3 comments
Open

SSL key #9

zbessler opened this issue Dec 11, 2014 · 3 comments

Comments

@zbessler
Copy link

I see in the readme that you support soap over SSL, but I cant find any documentation or examples on how you implement which key you use for SSL.

I currently have a setup to make use of the X509BinarySecurityToken and that adds everything to the request great, but how to I tell it what cert to use for SSL?

@yaronn
Copy link
Owner

yaronn commented Dec 23, 2014

X509BinarySecurityToken is a message security feature (not related to ssl). The message security samples in the README show how to use certificate.

SSL, is different, it is transport security. If you are the client than usually you do not have a certificate and the server will send it in runtime so nothing to do. If you do have a client ssl certificate then you can configure the npm 'request' module to use it in ws.js file: lib/handlers/client/http.js.

@jcampanaaxa
Copy link

jcampanaaxa commented Oct 21, 2016

Hi @yaronn, in the case we have key and cert...

it is enough to have the agentOptions object into ctx like this?

  let ctx = {
    request: xml,
    url: url,
    action: action,
    contentType: 'application/soap+xml',
    agentOptions: {
      key: certificate.key,
      cert: certificate.cert
    }
  };

And then

var handlers =  [new ws.Mtom(), new ws.Http()];
ws.send(handlers, ctx, function (ctx) {
...
});

@yaronn
Copy link
Owner

yaronn commented Oct 21, 2016

Hi, I assume you use ssl.
This should be enough. In the end all these settings are propagated to the request module here:

, agentOptions: ctx.agentOptions

so you should debug to verify they reach there and debug request if necessary.

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

3 participants