diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index a6cdc75a4bd9..dedf07ec91b1 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -37,6 +37,7 @@ "Add_users" : "Add users", "Administration" : "Administration", "All_channels" : "All channels", + "Allow_Invalid_SelfSigned_Certs": "Allow invalid and Self-Signed SSL certificate's for link validation and previews", "and" : "and", "API_Analytics" : "Analytics", "API_Embed" : "Embed", diff --git a/packages/rocketchat-lib/settings/server/startup.coffee b/packages/rocketchat-lib/settings/server/startup.coffee index f67cfa5ec2b7..b9fc80e7ae4c 100644 --- a/packages/rocketchat-lib/settings/server/startup.coffee +++ b/packages/rocketchat-lib/settings/server/startup.coffee @@ -33,6 +33,7 @@ Meteor.startup -> RocketChat.settings.addGroup 'General' RocketChat.settings.add 'Site_Name', 'Rocket.Chat', { type: 'string', group: 'General', public: true } + RocketChat.settings.add 'Allow_Invalid_SelfSigned_Certs', false, { type: 'boolean', group: 'General' } RocketChat.settings.addGroup 'API' RocketChat.settings.add 'API_Analytics', '', { type: 'string', group: 'API', public: true } diff --git a/packages/rocketchat-oembed/server/server.coffee b/packages/rocketchat-oembed/server/server.coffee index 45bf393e506c..35329c51b82a 100644 --- a/packages/rocketchat-oembed/server/server.coffee +++ b/packages/rocketchat-oembed/server/server.coffee @@ -15,7 +15,7 @@ getUrlContent = (urlObj, redirectCount = 5, callback) -> port: urlObj.port hostname: urlObj.hostname path: urlObj.path - rejectUnauthorized: false + rejectUnauthorized: !RocketChat.settings.get 'Allow_Invalid_SelfSigned_Certs' httpOrHttps = if urlObj.protocol is 'https:' then https else http