Created
June 22, 2016 22:52
-
-
Save jamischarles/eb1120df1de971fecc23ee6ed1658e38 to your computer and use it in GitHub Desktop.
Node https request to server with invalid SSL certs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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