Imported Upstream version 4.4.2.8

Former-commit-id: 35c92f977d4776b96adf6e2e2f8ebbe9c6724ef4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-07-26 08:49:14 +00:00
parent 0b4a830db1
commit 42e38034c4
17 changed files with 99 additions and 36 deletions

View File

@ -144,13 +144,25 @@ namespace Mono.Net.Security
bool result;
#if MONODROID
result = AndroidPlatform.TrustEvaluateSsl (certs);
if (result) {
// chain.Build() + GetErrorsFromChain() (above) will ALWAYS fail on
// Android (there are no mozroots or preinstalled root certificates),
// thus `errors` will ALWAYS have RemoteCertificateChainErrors.
// Android just verified the chain; clear RemoteCertificateChainErrors.
errors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
try {
result = AndroidPlatform.TrustEvaluateSsl (certs);
if (result) {
// FIXME: check whether this is still correct.
//
// chain.Build() + GetErrorsFromChain() (above) will ALWAYS fail on
// Android (there are no mozroots or preinstalled root certificates),
// thus `errors` will ALWAYS have RemoteCertificateChainErrors.
// Android just verified the chain; clear RemoteCertificateChainErrors.
errors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
} else {
errors |= SslPolicyErrors.RemoteCertificateChainErrors;
status11 = unchecked((int)0x800B010B);
}
} catch {
result = false;
errors |= SslPolicyErrors.RemoteCertificateChainErrors;
status11 = unchecked((int)0x800B010B);
// Ignore
}
#else
if (is_macosx) {