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

Can't access express server to setup ssl #110

Open
mchingiz opened this issue Feb 13, 2018 · 2 comments
Open

Can't access express server to setup ssl #110

mchingiz opened this issue Feb 13, 2018 · 2 comments

Comments

@mchingiz
Copy link

Hi, I was using heroku for messenger bot, now I want to move it to my own server. Because facebook wants webhook to be served from https, I am trying to setup ssl. But I don't have access to express server used in bootbot.

I tried to setup my own express server on port 3000 and bootbot server on 3100, then proxy all requests to port 3100 by using express-http-proxy module.
But I have ended up with this error: Couldn't validate the request signature.
I have checked other issues for this error(#14, #48, #84, #66, #67), mainly they say that problem originates from invalid APP_SECRET, but that's not the case with me.

So how can I setup ssl?

@mchingiz
Copy link
Author

I ended up using the second solution. I have created https server on port 3000, submitted that port as webhook, then redirected all requests to bootbot server on port 3100

app.post('*', function(req, res) {
        var url = "http://" + ipAddress + ":3100" + req.url;
        res.redirect(307,url);
});

I am not sure but I think it took a little while to take effect. I don't know why and couldn't recreate the situation.

I still think, it would be greate if we were able to create https server on bootbot by providing certificates.

@mchingiz mchingiz reopened this May 29, 2018
@mraaroncruz
Copy link
Collaborator

mraaroncruz commented May 29, 2018

You could put it behind nginx. Then have nginx handle the https. Or maybe something lighter weight like caddy which is https only (backed by letsencrypt):

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

2 participants