Botconnector not working for a self signed nodejs

2019-05-26 09:48发布

问题:

I created a simple bot. Self signed the ssl cert. Apparently that does not work for bot connector . I get following error form the bot, after several seconds.

{
    "error": {
        "code": "BadCertificate",
        "message": "An error occurred while sending the request. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure. ",
        "statusCode": 500
    }
}

Does that mean self signed certificates are out of question for the bot? Any work around this problem?

回答1:

In short, yes, self-signed certs are not supported.

If you use HTTPS, you must have a properly chained cert. The Bot Connector uses standard server certificate validation to make sure your site is what it claims to be. Put another way, if you point a browser to your bot and your browser thinks the cert is legit, the Bot Connector likely will, too. If your browser doesn't like it, the Bot Connector probably won't either.

This is true for bots implemented in all languages.