Re:The most dangerous code in the world
by gingerlime on Thursday October 25, 2012 @03:13AM
(#4696665)
Good to know. I always wondered how come none those libraries fully validate SSL certificates. On one of my projects, we were hooking into the Windows Winhttp Libraries to be able to do this (and a couple of other things), but when porting to Mac we kinda had to accept the standard libs just didn't care enough about this. It's been a while ago, so perhaps things have changed. Requests is a great example of this I guess.
Well, it does the right thing by default if you have a sufficiently recent version. You still need to pass `verify=True` to make older versions fail rather than silently accept bad certs. For httplib2, the idiom is similar:
`client = httplib2.Http(disable_ssl_certificate_validation=False)`
http://docs.python-requests.org/en/latest/
It validates SSL certificates correctly by default. How about other languages?