puppetlabs/puppet — pull request #1490 by celesteking (2013-02-21 20:26:50+00:00)
Title: fix certificate subject CN extraction and exception handling in verify_cb

This is a pull request that supposedly would address several tickets:
http://projects.puppetlabs.com/issues/17879
http://projects.puppetlabs.com/issues/15561
All those relate to custom certificate subjects.

Consists of 2 commits, each addressing a different problem:
* for ssl/base.rb, fixes CN extraction from certificate subject name.
* for http/connection.rb, it adds exception handling that prevents you from raising eyebrows when something panics in verify_callback routine. Please note, that I don't fail the verification and return previously set status -- not sure whether this is a good move, but anyways, better than it was.

By applying this, we make 1 SSL/cert test fail:
`rspec ./spec/unit/ssl/base_spec.rb:41 # Puppet::SSL::Certificate when determining a name from a certificate subject should convert it to a string`
This is okay, because the test itself is wrong -- if you name your routine "name_from_subject", be sure to pass X500-like subject, not an arbitrary string.

Thanks.