[BTLS]: Certificate cleanups and fixes. (#3706)
* [BTLS]: Allow fallback to MX.X509Certificate in X509CertificateImplBtls.
* [BTLS]: Fix X509Certificate2.MonoCertificate.
* X509Certificate2Impl.FallbackImpl: make abstract.
* X509Helper2.GetMonoCertificate(): new internal helper method.
* X509Certificate2.MonoCertificate: use X509Helper2.GetMonoCertificate().
This is only used by X509ChainImplMono; we should investigate whether we
could implement the missing APIs in BTLS.
* [BTLS]: Fully implement X509CertificateImplBtls.Import() and use correct semantics.
.NET's X509Certificate2.Import() uses several implicit fallbacks which we previously
did not handle in BTLS.
* you may provide a (unused) password when importing an unencrypted PKCS#8.
* when using null as password, it will attempt to use string.Empty if importing
without password fails.
* [BTLS]: Implement X509CertificateImplBtls.PrivateKey.
* [BTLS]: Implement X509CertificateImplBtls.Export().
* [BTLS]: Implement X509CertificateImplBtls.Verify().
* [BTLS]: Fix X500DistinguishedName quoting.
* MonoBtlsUtils: don't quote special chars in UTF-16 strings.
* X500DistinguishedName: don't decode raw data when passed in a name.
* [ci] Test System.dll with both the legacy and btls TLS provider
* [ci] Only run the additional btls System.dll test run on OSX for now
Otherwise we might run it on platforms where btls isn't supported yet and get errors.
16 files changed: