Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Rocket notifier, set SSL validation to False #91

Open
hanynowsky opened this issue Sep 21, 2017 · 1 comment
Open

Rocket notifier, set SSL validation to False #91

hanynowsky opened this issue Sep 21, 2017 · 1 comment

Comments

@hanynowsky
Copy link

hanynowsky commented Sep 21, 2017

  • Rocket webhook urls are in https format. To be able to send a notification to Rocket, we need to set set SS validation to False. Otherwise a SSL handshake error is thrown and notification is not delivered.
  • This is the minor modification:

`

#######
import requests
import traceback

class RocketNotifier:
    def notify(self, notification):

        try:
            payload = { 
                      "text": notification.message
                    }

            response = requests.post(notification.user_to_notify.profile.rocket_webhook_url, payload, verify=False)

            if response.status_code == 200:
                print "Rocket message sent"
            else:
                print "Failed to send Rocket message, API response %s " % response.status_code
        except Exception as e:
            print "Failed to send Rocket message"
            #print(str(e))
            traceback.print_exc()
            raise
@sysrex
Copy link

sysrex commented Nov 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants