allow insecure connections (Cherry pick)

This commit is contained in:
Giuseppe Marino 2020-11-10 20:12:00 +01:00
parent b942c2a58b
commit d3a038f35d
No known key found for this signature in database
GPG Key ID: 2BC70C5463357449
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ Get information about a message
#### Executable flag `relative`
If enabled, allow only relative paths for files in local mode.
#### Executable flag `insecure` (not yet implemented)
#### Executable flag `insecure`
Allow http connection in non-local mode

View File

@ -654,7 +654,7 @@ void WebhookActor::start_up() {
pending_new_connection_flood_.add_limit(1, 1);
if (!parameters_->local_mode_) {
if (url_.protocol_ == td::HttpUrl::Protocol::Https) {
if (url_.protocol_ == td::HttpUrl::Protocol::Https || (parameters_->allow_http_ && url_.protocol_ == td::HttpUrl::Protocol::Http)) {
if (url_.port_ != 443 && url_.port_ != 88 && url_.port_ != 80 && url_.port_ != 8443) {
VLOG(webhook) << "Can't create webhook: port " << url_.port_ << " is forbidden";
on_error(td::Status::Error("Webhook can be set up only on ports 80, 88, 443 or 8443"));