Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm package: not able to perform the handshake with APIM #84

Open
lkappeler opened this issue Aug 9, 2017 · 5 comments
Open

Npm package: not able to perform the handshake with APIM #84

lkappeler opened this issue Aug 9, 2017 · 5 comments

Comments

@lkappeler
Copy link

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);
@GeetaKrishnaAdhikari
Copy link

Same issue for me too. Is there any solution? It'll be helpfull.

@chaobeck
Copy link

Is there a resolution to this issue?

@smartmouse
Copy link

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?

@lkappeler
Copy link
Author

lkappeler commented Nov 2, 2017

@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)

@smartmouse
Copy link

smartmouse commented Nov 3, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants