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

Is there possibility to use bot with https? #1223

Closed
Reg93 opened this issue Dec 1, 2022 · 3 comments
Closed

Is there possibility to use bot with https? #1223

Reg93 opened this issue Dec 1, 2022 · 3 comments

Comments

@Reg93
Copy link

Reg93 commented Dec 1, 2022

Hello! I checked other issues but didn't find where https is mentioned. Is there options which can make server work on https?
I have such code in project now

{
  "settings": {
    "nlp": {
      "corpora": [{ "filename": "./corpora/qna.tsv", "importer": "qna", "locale": "en" }]
    },
    "api-server": { "port": 3000, "serveBot": true, "clientPath": "./public"}
  },
  "use": ["Basic", "Qna", "LangEn", "ExpressApiServer", "DirectlineConnector"]
}
``
@aigloss
Copy link
Collaborator

aigloss commented Dec 2, 2022

Hi @Reg93 ,

as of now, there is no out of the box support for https.

When using the ExpressApiServer component, the server is created here:

this.server = this.app.listen(port, () => {
const logger = this.container.get('logger');
logger.info(`${this.settings.tag} listening on port ${port}!`);
});

What you can do, is to create a custom component, extending the current ExpressApiServer, and overwrite the start method to create an HTTPS server instead of the default HTTP one (you can check the express method docs on that listen method for more details (https://github.com/expressjs/express/blob/8368dc178af16b91b576c4c1d135f701a0007e5d/lib/application.js#L612-L636).

Finally, just register your plugin instead of the ExpressAPIServer one.

OR

Modify the current ExpressApiServer so that it supports both modes, and contribute with the change 😬

@jesus-seijas-sp
Copy link
Contributor

jesus-seijas-sp commented Dec 2, 2022

This was intentional by design. Usually, you'll deploy into a cloud, and the certificates will be managed, so you don't really need to have the cert management in the development. If you are deploying on-premise, you usually configure a reverse proxy like Nginx, which already will take care of the certs.

@Reg93
Copy link
Author

Reg93 commented Dec 3, 2022

This was intentional by design. Usually, you'll deploy into a cloud, and the certificates will be managed, so you don't really need to have the cert management in the development. If you are deploying on-premise, you usually configure a reverse proxy like Nginx, which already will take care of the certs.

Thank you!

@aigloss aigloss closed this as completed Dec 15, 2022
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

3 participants