I think we need a `/CN` here, not just `.*?CN`.

Also, we could make this a bit more compact with:

```ruby
if md = subject.to_s.match(/^.*?\/CN\s*=\s*([^\/]*)/)
  md[1]
end
```

Also, we should look at extracting the common name using the x.509 methods on the subject instance.