Forum Discussion
David_G__33241
Sep 11, 2017Nimbostratus
unable to verify the first certificate with node.js
I am trying to read a datagroup using node.js and am receiving the message "unable to verify the first certificate". I have confirmed the command manually with curl and it does return the datagro...
Sep 12, 2017
Which node library are you using? I have a Node.js script using the core https module accessing the REST interface without a problem. I did have to set the rejectUnauthorized attribute to not to validate the self cert.
A section of the code looks like this:
var http_opts = {
host: BIGIP,
method: verb,
port: 443,
rejectUnauthorized: 0,
path: resource
};
var http_headers = {
'Content-Type': 'application/json'
};
// Authentication Method
user = USER;
pass = PASS;
if ( user && pass ) { http_opts["auth"] = user + ":" + pass; }
else if ( token ) { http_headers["X-F5-Auth-Token"] = token; }
// BODY?
if ( body ) { http_headers["Content-Length"] = body.length; }
http_opts["headers"] = http_headers;
var content = "";
var req = https.request(http_opts, function(res) {
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects