public static SafeMsQuicConfigurationHandle Create(QuicClientConnectionOptions options)
{
X509Certificate? certificate = null;
- if (options.ClientAuthenticationOptions?.ClientCertificates != null)
+
+ if (options.ClientAuthenticationOptions != null)
{
- foreach (var cert in options.ClientAuthenticationOptions.ClientCertificates)
+ if (options.ClientAuthenticationOptions.CipherSuitesPolicy != null)
{
- try
+ throw new PlatformNotSupportedException(SR.Format(SR.net_quic_ssl_option, nameof(options.ClientAuthenticationOptions.CipherSuitesPolicy)));
+ }
+
+ if (options.ClientAuthenticationOptions.EncryptionPolicy == EncryptionPolicy.NoEncryption)
+ {
+ throw new PlatformNotSupportedException(SR.Format(SR.net_quic_ssl_option, nameof(options.ClientAuthenticationOptions.EncryptionPolicy)));
+ }
+
+ if (options.ClientAuthenticationOptions.ClientCertificates != null)
+ {
+ foreach (var cert in options.ClientAuthenticationOptions.ClientCertificates)
{
- if (((X509Certificate2)cert).HasPrivateKey)
+ try
{
- // Pick first certificate with private key.
- certificate = cert;
- break;
+ if (((X509Certificate2)cert).HasPrivateKey)
+ {
+ // Pick first certificate with private key.
+ certificate = cert;
+ break;
+ }
}
+ catch { }
}
- catch { }
}
}