135 {
137 global::Interop.SspiCli.CredentialUse
credUsage;
138 global::Interop.SspiCli.SCH_CREDENTIALS.Flags flags;
140 {
141 credUsage = global::Interop.SspiCli.CredentialUse.SECPKG_CRED_INBOUND;
142 flags = global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_SEND_AUX_RECORD;
143 }
144 else
145 {
146 credUsage = global::Interop.SspiCli.CredentialUse.SECPKG_CRED_OUTBOUND;
147 flags = global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_CRED_MANUAL_CRED_VALIDATION | global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_CRED_NO_DEFAULT_CREDS | global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_SEND_AUX_RECORD;
148 }
150 {
151 case EncryptionPolicy.RequireEncryption:
153 {
154 flags |= global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_USE_STRONG_CRYPTO;
155 }
156 break;
157 case EncryptionPolicy.AllowNoEncryption:
158 flags |= global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_ALLOW_NULL_ENCRYPTION;
159 break;
160 default:
162 }
163 global::Interop.SspiCli.SCH_CREDENTIALS
sCH_CREDENTIALS =
default(global::Interop.SspiCli.SCH_CREDENTIALS);
164 sCH_CREDENTIALS.dwVersion = 5;
165 sCH_CREDENTIALS.dwFlags = flags;
166 global::Interop.Crypt32.CERT_CONTEXT*
ptr =
null;
168 {
169 sCH_CREDENTIALS.cCreds = 1;
170 ptr = (global::Interop.Crypt32.CERT_CONTEXT*)(
void*)
certificate.Handle;
171 sCH_CREDENTIALS.paCred = &
ptr;
172 }
174 {
175 System.
Net.
NetEventSource.
Info(
$"flags=({flags}), ProtocolFlags=({protocolFlagsFromSslProtocols}), EncryptionPolicy={policy}",
null,
"AcquireCredentialsHandleSchCredentials");
176 }
178 {
179 global::Interop.SspiCli.TLS_PARAMETERS
tLS_PARAMETERS =
default(global::Interop.SspiCli.TLS_PARAMETERS);
181 sCH_CREDENTIALS.cTlsParameters = 1;
183 }
185 }
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static SafeFreeCredentials AcquireCredentialsHandle(SslStreamCertificateContext certificateContext, SslProtocols protocols, EncryptionPolicy policy, bool isServer)
static int GetProtocolFlagsFromSslProtocols(SslProtocols protocols, bool isServer)
static string net_invalid_enum
static string Format(string resourceFormat, object p1)