apigee-127 / a127-samples

21 stars 29 forks source link

Error running the security-apikey-apigee sample with an on-premise installation #17

Open aabeling opened 9 years ago

aabeling commented 9 years ago

Hi,

we have an on-premise installation. First we had problems to start the project locally at all. The solution for that problem was to adjust the config/default.yaml with

 managementUri: "http://our-host:8080"

and config/index.js with

 exports.appRequest = {
   name: 'A127 Sample App',
   environments: ['dev-online' ]
 };

Now the project is able to start but executing the example curl command results in

 $ curl 'http://127.0.0.1:10010/hello?name=Scott&apiKey=n8EkeaA8axNLCAPOOJigV6LZskbmNW5q'
 Error
 at makeError (/home/aabeling/Projects/github/a127-samples/security-apikey-apigee/node_modules/volos-oauth-apigee/node_modules/volos-oauth-common/lib/oauth.js:531:13)
 at /home/aabeling/Projects/github/a127-samples/security-apikey-apigee/node_modules/volos-oauth-apigee/node_modules/volos-oauth-common/lib/oauth.js:492:12
 at /home/aabeling/Projects/github/a127-samples/security-apikey-apigee/node_modules/volos-oauth-apigee/lib/apigeeruntime.js:292:23
 at /home/aabeling/Projects/github/a127-samples/security-apikey-apigee/node_modules/volos-oauth-apigee/lib/apigeeruntime.js:120:11
 at Request.callback (/home/aabeling/Projects/github/a127-samples/security-apikey-apigee/node_modules/volos-oauth-apigee/node_modules/superagent/lib/node/index.js:746:30)
 at ClientRequest.<anonymous> (/home/aabeling/Projects/github/a127-samples/security-apikey-apigee/node_modules/volos-oauth-apigee/node_modules/superagent/lib/node/index.js:711:10)
 at ClientRequest.emit (events.js:95:17)
 at CleartextStream.socketErrorListener (http.js:1547:9)
 at CleartextStream.emit (events.js:95:17)
 at SecurePair.<anonymous> (tls.js:1384:19) 
aabeling commented 9 years ago

With debugging turned on I get

   oauth verifyApiKey: DC0zVGsCNjAtFsG7O7Ci4N7HwhJk3jjl +21s
   apigee Error getting version: Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE +115ms
aabeling commented 9 years ago

Running workaround as supposed in https://github.com/visionmedia/superagent/issues/188:

adding

 process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

to app.js. Should this be configurable in any way?