-
• #2
Got it, you need to specify an undocumented parameter in options called
protocol
, and set it tohttps:
(note the trailing colon).var options = { host: 'google.com', protocol: 'https:', port: 443, path: '/', method: 'GET', };
-
• #3
Thanks - I've just updated the docs, so it'll be on the main site next time I update
In the docs I can see there is provision for HTTPS when using
http.get
, you just pass ahttps://
url and it works it out. But what about when usinghttp.request
?Works fine, but if I change the port to 443 it just stalls. I assume because its trying to talk HTTP to a HTTPS port. I don't really want to use
tls.connect
because that gives me a socket rather than a https connection.