From: Tom Hunger Date: Thu, 22 Jan 2015 17:12:04 +0000 (+0000) Subject: Disable every and all security when rendering HTML via phantomjs. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=8b93d242a9dbefa558379adcec5e73caf6faed48;p=sirius.git Disable every and all security when rendering HTML via phantomjs. We're not protecting a user's logged in session or private information, we're using phantomjs to render publicly available content so we don't really care whether a website's certificate checks out, or whether the SSL version is older than the cambrian explosion. --- diff --git a/sirius/coding/image_encoding.py b/sirius/coding/image_encoding.py index 57cdb5d..cadc3bf 100644 --- a/sirius/coding/image_encoding.py +++ b/sirius/coding/image_encoding.py @@ -100,7 +100,10 @@ def html_to_png(html): """ from selenium import webdriver try: - driver = webdriver.PhantomJS('phantomjs') + caps = {'acceptSslCerts': True} + driver = webdriver.PhantomJS( + 'phantomjs', desired_capabilities=caps, + service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any']) driver.set_window_size(384, 5) # note that the .html suffix is required to make phantomjs