Skip to content

Instantly share code, notes, and snippets.

@jamischarles
Created June 22, 2016 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamischarles/eb1120df1de971fecc23ee6ed1658e38 to your computer and use it in GitHub Desktop.
Save jamischarles/eb1120df1de971fecc23ee6ed1658e38 to your computer and use it in GitHub Desktop.
Node https request to server with invalid SSL certs
// use this when you can curl an https server, but node request() will return 'econnreset: socket hang up'
var options = {
url: 'https://some/site',
method: 'POST',
// these 3 lines matter
strictSSL: false,
secureProtocol: 'TLSv1_method',
rejectUnhauthorized: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment