Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Unable to make https request when Oid lookup takes too long #21320

Merged
merged 8 commits into from Jul 4, 2017
Expand Up @@ -20,6 +20,9 @@ internal class SecureChannel
{
// When reading a frame from the wire first read this many bytes for the header.
internal const int ReadHeaderSize = 5;
private const OidGroup CRYPT_OID_DISABLE_SEARCH_DS_FLAG = (OidGroup)(unchecked((int)0x80000000));
private const OidGroup LocalEku = CRYPT_OID_DISABLE_SEARCH_DS_FLAG | OidGroup.EnhancedKeyUsage;

private SafeFreeCredentials _credentialsHandle;
private SafeDeleteContext _securityContext;
private readonly string _destination;
Expand Down Expand Up @@ -48,8 +51,8 @@ internal class SecureChannel

private bool _refreshCredentialNeeded;

private readonly Oid _serverAuthOid = new Oid("1.3.6.1.5.5.7.3.1");
private readonly Oid _clientAuthOid = new Oid("1.3.6.1.5.5.7.3.2");
private readonly Oid _serverAuthOid = Oid.FromOidValue("1.3.6.1.5.5.7.3.1", LocalEku);
private readonly Oid _clientAuthOid = Oid.FromOidValue("1.3.6.1.5.5.7.3.2", LocalEku);

internal SecureChannel(string hostname, bool serverMode, SslProtocols sslProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool remoteCertRequired, bool checkCertName,
bool checkCertRevocationStatus, EncryptionPolicy encryptionPolicy, LocalCertSelectionCallback certSelectionDelegate)
Expand Down