Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1998)

Issue 4425052: Adds optional support for SSL server certificate validation

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by xtof.g
Modified:
13 years ago
Reviewers:
Mike Schwartz, mitch.garnaat
Visibility:
Public.

Patch Set 1 #

Total comments: 24

Patch Set 2 : Address Mike's code review feedback. #

Total comments: 5

Patch Set 3 : Address Mike's 2nd round of feedback. #

Patch Set 4 : Formatting cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1036 lines, -10 lines) Patch
A boto/cacerts/__init__.py View 0 chunks +-1 lines, --1 lines 0 comments Download
A boto/cacerts/cacerts.txt View 1 chunk +633 lines, -0 lines 0 comments Download
M boto/connection.py View 1 2 3 6 chunks +69 lines, -10 lines 0 comments Download
A boto/https_connection.py View 1 2 1 chunk +121 lines, -0 lines 0 comments Download
A tests/s3/other_cacerts.txt View 1 chunk +70 lines, -0 lines 0 comments Download
A tests/s3/test_https_cert_validation.py View 1 2 1 chunk +137 lines, -0 lines 0 comments Download
M tests/test.py View 4 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 12
Mike Schwartz
I suggest renaming this issue to "Adds optional support for SSL server certificate validation", to ...
13 years ago (2011-04-19 23:49:13 UTC) #1
xtof.g
On 2011/04/19 23:49:13, Mike Schwartz wrote: > I suggest renaming this issue to "Adds optional ...
13 years ago (2011-04-20 15:02:03 UTC) #2
xtof.g
Thanks for your feedback, PTAL. http://codereview.appspot.com/4425052/diff/1/boto/connection.py File boto/connection.py (right): http://codereview.appspot.com/4425052/diff/1/boto/connection.py#newcode72 boto/connection.py:72: 'No ssl module found. ...
13 years ago (2011-04-20 16:18:38 UTC) #3
Mike Schwartz
LGTM http://codereview.appspot.com/4425052/diff/7001/tests/s3/test_https_cert_validation.py File tests/s3/test_https_cert_validation.py (right): http://codereview.appspot.com/4425052/diff/7001/tests/s3/test_https_cert_validation.py#newcode47 tests/s3/test_https_cert_validation.py:47: # File 'other_cacerts.txt' contains a valid CA certificate ...
13 years ago (2011-04-20 17:04:10 UTC) #4
Mitch
http://codereview.appspot.com/4425052/diff/7001/boto/connection.py File boto/connection.py (right): http://codereview.appspot.com/4425052/diff/7001/boto/connection.py#newcode77 boto/connection.py:77: os.path.dirname(os.path.abspath(cacerts.__file__ )), "cacerts.txt") I wish I could think of ...
13 years ago (2011-04-21 15:38:27 UTC) #5
xtof.g
Hi Mitch, thanks for taking a look! On Thu, Apr 21, 2011 at 08:38, <Mitch.Garnaat@gmail.com> ...
13 years ago (2011-04-21 16:36:53 UTC) #6
Mitch
On 2011/04/21 16:36:53, xtof.g wrote: > Hi Mitch, > > thanks for taking a look! ...
13 years ago (2011-04-21 16:45:10 UTC) #7
xtof.g
On Thu, Apr 21, 2011 at 09:45, <Mitch.Garnaat@gmail.com> wrote: > On 2011/04/21 16:36:53, xtof.g wrote: ...
13 years ago (2011-04-21 16:55:51 UTC) #8
Mike Schwartz
Thanks for looking over the code Mitch. Ok if I commit this to boto later ...
13 years ago (2011-04-21 17:24:23 UTC) #9
mitch.garnaat_gmail.com
Yes, please do! Mitch On Thu, Apr 21, 2011 at 1:24 PM, Michael Schwartz <mfschwartz@google.com>wrote: ...
13 years ago (2011-04-21 17:41:44 UTC) #10
xtof.g
http://codereview.appspot.com/4425052/diff/7001/tests/s3/test_https_cert_validation.py File tests/s3/test_https_cert_validation.py (right): http://codereview.appspot.com/4425052/diff/7001/tests/s3/test_https_cert_validation.py#newcode47 tests/s3/test_https_cert_validation.py:47: # File 'other_cacerts.txt' contains a valid CA certificate of ...
13 years ago (2011-04-22 04:53:16 UTC) #11
Mike Schwartz
13 years ago (2011-04-22 18:20:24 UTC) #12
Hi Mitch,

I just
committed<https://github.com/boto/boto/commit/ad0f4aa82a8f30522b0ce3e40e40f145080bf955>Christoph's
changes.

I suggest announcing this change on the boto mailing list, noting that:

   - this change addresses a man-in-the-middle vulnerability of the Python
   httplib. (I think that vulnerability is fixed in one of the more recent 3.x
   libraries.)
   - by default cert validation is off
   - it can be enabled by adding "https_validate_certificates = True" to the
   [Boto] section of the boto config file
   - enabling cert validation may cause your app to fail if you were
   dependent on invalid certs
   - at some point we hope to make cert validation the default for HTTPS
   connections

Thanks,

Mike


On Thu, Apr 21, 2011 at 10:41 AM, Mitchell Garnaat
<mitch.garnaat@gmail.com>wrote:

> Yes, please do!
>
> Mitch
>
>
> On Thu, Apr 21, 2011 at 1:24 PM, Michael Schwartz
<mfschwartz@google.com>wrote:
>
>> Thanks for looking over the code Mitch.
>> Ok if I commit this to boto later today/tonight?
>>
>> Mike
>>
>>
>> On Thu, Apr 21, 2011 at 9:45 AM, <Mitch.Garnaat@gmail.com> wrote:
>>
>>> On 2011/04/21 16:36:53, xtof.g wrote:
>>>
>>>> Hi Mitch,
>>>>
>>>
>>>  thanks for taking a look!
>>>>
>>>
>>>  On Thu, Apr 21, 2011 at 08:38, <mailto:Mitch.Garnaat@gmail.com> wrote:
>>>>
>>>
>>>  >
>>>> > http://codereview.appspot.com/4425052/diff/7001/boto/connection.py
>>>> >
>>>> > File boto/connection.py (right):
>>>> >
>>>> >
>>>> >
>>>>
>>>
>>> http://codereview.appspot.com/4425052/diff/7001/boto/connection.py#newcode77
>>>
>>>> > boto/connection.py:77:
>>>>
>>> os.path.dirname(os.path.abspath(cacerts.__file__
>>>
>>>> > )), "cacerts.txt")
>>>> > I wish I could think of a better way of doing this but I really
>>>>
>>> can't.
>>>
>>>> > Python doesn't provide any standard mechanisms for accessing data
>>>>
>>> files,
>>>
>>>> > AFAIK.  This is a clever hack but it's still a hack.  Is there any
>>>> > precedence for this in other packages?
>>>>
>>>
>>>  I think it's pretty common to use __file__ to find the directory a
>>>>
>>> module
>>>
>>>> came from.  The trick of making the directory with the cacerts file an
>>>> otherwise empty module is something I thought of; I'm not sure I've
>>>>
>>> seen
>>>
>>>> this before.
>>>>
>>>
>>>  I suppose there are lots of things in python that one could call both
>>>> "elegant" and "a terrible hack" at the same time :)
>>>>
>>>
>>>
>>> I didn't call it a "terrible hack", just a hack.  And a clever one at
>>> that.  If there was some nice, clean, standard mechanism for doing this
>>> then I would argue for using it but there isn't so this seems as good a
>>> solution as any and better than most.
>>>
>>>
>>>  I could get rid of that cacerts package and reference the file
>>>>
>>> relative to
>>>
>>>> the boto root directory, but I don't know of any other way besides
>>>>
>>> __file__
>>>
>>>> to find out where the boto package is installed.
>>>>
>>>
>>>
>>>
>>>  >
>>>> >
>>>> > http://codereview.appspot.com/4425052/
>>>> >
>>>>
>>>
>>>
>>>
>>> http://codereview.appspot.com/4425052/
>>>
>>
>>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b