Don't forget to specify an agent of explicitly set agent = false. If you don't the global agent will be used and your certificate will be ignored. There's a note about that behavior in http://nodejs.org/api/https.html#https_https_request_options_callback but I recently overlooked that and it took me a while to figure out what was going wrong.
On Thu, Aug 30, 2012 at 12:42 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote: > On Thu, Aug 30, 2012 at 4:33 PM, Eric <e...@craftti.com.br> wrote: > > Hi Guys, > > > > My node.js app needs to tal with a webservice using soap over HTTPS > > connection but using his own SSL certificate (self-signed certificate). > In > > other languages like java all I need to do is import the PEM file into > the > > JRE keystore to make it trusted, and when the soap clients communicate > with > > the webservice everything goes fine. > > > > I can't seem to figure out however how should I do this in node.js. > Where is > > the keystore used by node.js? > > Take a look at the documentation for https.request() and > tls.connect(). You pass the certificate in an options object, e.g. > > var options = url.parse('https://example.com/'); > options.cert = fs.readFileSync('example.pem'); > var req = https.request(options, cb); > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en