English Forums > Tutorials and FAQs
Script to send emails for updates
philamonster:
Thanks for update. Working on Debian 7.9 w/python 2.7.3.
TheLatestWire:
The script was working for me until I just updated python on my Gentoo system. Now I get this when I run it. Any ideas would be greatly appreciated.
(163) --> python2.7 fw_update1.1.py
/usr/lib64/python2.7/site-packages/urllib3/connectionpool.py:790: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
Traceback (most recent call last):
File "fw_update1.1.py", line 28, in <module>
response = json.loads(r.text)
File "/usr/lib64/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
bartjsmit:
The unverified HTTPS points to a x509 certificate chain issue, rather than Python.
Make sure you have a trusted certificate bound to the OPNsense webConfigurator under Certificates and that its root CA as well as any intermediate CA's in the trust chain are imported under Authorities. Both menus are under System:Trust in the web interface. Don't forget to restart the webConfigurator afterwards.
You can either create an internal CA for this and set your Gentoo to trust it, or you can get a publicly trusted certificate for your firewall. I rent a cheap wildcard certificate from startssl.com for my home network.
If you just want stuff to work without worrying about certs, you can of course set verify=False in the request.get line, but Python will lecture you (quite rightly) about your poor OpSec 8)
Bart...
TheLatestWire:
I have verify set to FALSE in the script -> "r = requests.get(url,verify=False"
It's the other errors that I don't know what to do with.
Traceback (most recent call last):
File "fw_update1.1.py", line 28, in <module>
response = json.loads(r.text)
File "/usr/lib64/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
I'm using Python 2.7.11 on Gentoo.
Thanks.
TheLatestWire:
Upon further investigation I'm running python 2.7.11-r2 which is listed as unstable in the Gentoo dev-lang/python package. Apparently it's nearly impossible to move back the stable branch of python due to reverse dependencies.
So maybe 2.7.11-r2 is the issue and it would work with 2.7.10-r1?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version