microgateway
microgateway copied to clipboard
Npm package: not able to perform the handshake with APIM
We are trying to use the Microgateway standalone for our project.
When I clone the github repo and do the Getting Started the code works fine. When I install the Npm-Package and try to adapt the getting started code I am running into the following error
Error: not able to perform the handshake with APIM, error: Error: can not load default private key
at Object.exports.handshakeWithAPIm (/Users/tones/Documents/Projekte/JB/sbc/microgateway-playground/node_modules/microgateway/utils/utils.js:192:14)
at performHandshake (/Users/tones/Documents/Projekte/JB/sbc/microgateway-playground/node_modules/microgateway/lib/analytics.js:251:9)
at sendAnalytics (/Users/tones/Documents/Projekte/JB/sbc/microgateway-playground/node_modules/microgateway/lib/analytics.js:49:3)
at Object.<anonymous> (/Users/tones/Documents/Projekte/JB/sbc/microgateway-playground/node_modules/microgateway/lib/microgw.js:37:9)
Here is the js I am using to launch the app
'use strict';
process.env.CONFIG_DIR = __dirname + '/definitions/catapi';
process.env.NODE_ENV = 'production';
process.env.PORT = 3333;
const microgateway = require('./node_modules/microgateway/lib/microgw');
microgateway.start(process.env.PORT);
Same issue for me too. Is there any solution? It'll be helpfull.
Is there a resolution to this issue?
which version of microgateway are you using? What node version and npm version and os? There is a new version just published, does it resolve your issue?
@smartmouse Thanks for your answer I do still run into the same problem with the latest package, created a sample projet to reproduce the error
Node: 8.9 OS: ubuntu (did not retest but the same happend on my macbook in august)
Thanks for the sample project. I can still reproduce your error with node 6.x and mac OSx.
:microgateway-test-master smartmouse$ node index.js
Error: not able to perform the handshake with APIM, error: [Error: can not load default private key]
vi index.js
I think the reason why it works when you git clone vs when you are npm installing it, could be some config files and mock-apim-server are included and loaded properly when are loaded automatically in the git clone.
I will need to check with the developers on what could be the root cause .
But you still should be able to request the api, still should be functional regardless of the error.