mono/mono — pull request #1444 by omerdun (2014-12-05 17:14:51+00:00)
Title: Add default behavior to certificate selection callback.

The current state:
In case of creation of an SslStream object using the constructor with 3
parameters (without explicitly providing the
LocalCertificateSelectionClassbackDelegate) no certificate is ever
selected.
A problomatic scenario:
1. Server and Client are using SslStream class in order to perform 2-way
ssl. The client calls AutheticateAsClient with exactly one client
certificate in the X509CertificateCollection.
2. The client initialize the SslStream class using the constructor with
3 parameters.
The operation will be failed for sure.

In fact the problem is not that easy to detect\debug - because in case
the certificate selection callback is null there is no "Fail-First"
exception - and simply the client returns a certificate with 0 bytes to
the server; then the server hit an exception.

The fix is quite simple - just add a defualt behavior of certificate
selection method (which simply selects the first certificate in the
collection).

I also tested it in .Net enviornment and it also provide a similar
default behavior.