35 writes to ServerCertificate
Certificate.Optional.Sample (2)
Program.cs (2)
44ServerCertificate = serverCertificate, 53ServerCertificate = serverCertificate,
Http3SampleApp (3)
Program.cs (3)
75httpsOptions.OnAuthenticate = (_, sslOptions) => sslOptions.ServerCertificate = cert; 88ServerCertificate = cert, 105ServerCertificate = cert,
InMemory.FunctionalTests (10)
HttpsConnectionMiddlewareTests.cs (8)
176ServerCertificate = _x509Certificate2, 251ServerCertificate = _x509Certificate2, 343ServerCertificate = _x509Certificate2 667ServerCertificate = _x509Certificate2, 714ServerCertificate = _x509Certificate2, 924ServerCertificate = _x509Certificate2, 955ServerCertificate = _x509Certificate2, 987ServerCertificate = _x509Certificate2,
HttpsTests.cs (2)
410ServerCertificate = _x509Certificate2, 766authOptions.ServerCertificate = testCert;
Interop.FunctionalTests (2)
Http3\Http3RequestTests.cs (1)
1648ServerCertificate = TestResources.GetTestCertificate()
Http3\Http3TlsTests.cs (1)
308ServerCertificate = TestResources.GetTestCertificate(),
Kestrel.SampleApp (1)
Startup.cs (1)
141ServerCertificate = localhostCert
Microsoft.AspNetCore.Server.Kestrel.Core (7)
Internal\SniOptionsSelector.cs (4)
52ServerCertificate = serverCert, 67sslOptions.ServerCertificate = fallbackHttpsOptions.ServerCertificate; 166sslOptions.ServerCertificate = fallbackCertificate; 198ServerCertificate = sslOptions.ServerCertificate,
Middleware\HttpsConnectionMiddleware.cs (3)
338ServerCertificate = _serverCertificate, 544ServerCertificate = httpsOptions.ServerCertificate, 552sslServerAuthenticationOptions.ServerCertificate = null;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
SniOptionsSelectorTests.cs (1)
852ServerCertificate = new X509Certificate2(Array.Empty<byte>()),
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (5)
QuicConnectionListenerTests.cs (4)
246options.ServerCertificate = TestResources.GetTestCertificate(); 310options.ServerCertificate = TestResources.GetTestCertificate(); 345options.ServerCertificate = TestResources.GetTestCertificate(); 438options.ServerCertificate = TestResources.GetTestCertificate();
QuicTestHelpers.cs (1)
86sslServerAuthenticationOptions.ServerCertificate = cert;
System.Net.Security (4)
System\Net\Security\SslStream.cs (4)
286ServerCertificate = serverCertificate, 356ServerCertificate = serverCertificate, 410ServerCertificate = serverCertificate, 423ServerCertificate = serverCertificate,
46 references to ServerCertificate
InMemory.FunctionalTests (4)
HttpsTests.cs (4)
464Assert.Equal(_x509Certificate2, sslServerAuthenticationOptions.ServerCertificate); 508Assert.Equal(_x509Certificate2, sslServerAuthenticationOptions.ServerCertificate); 728Assert.Same(testCert, authOptions.ServerCertificate); 764Assert.Null(authOptions.ServerCertificate);
Microsoft.AspNetCore.Server.Kestrel.Core (6)
Internal\SniOptionsSelector.cs (6)
57if (sslOptions.ServerCertificate is null) 71if (sslOptions.ServerCertificate != null) 75sslOptions.ServerCertificateContext = SslStreamCertificateContext.Create((X509Certificate2)sslOptions.ServerCertificate, additionalCertificates: fullChain); 78if (!certifcateConfigLoader.IsTestMock && sslOptions.ServerCertificate is X509Certificate2 cert2) 152if (sslOptions.ServerCertificate is null) 198ServerCertificate = sslOptions.ServerCertificate,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (26)
SniOptionsSelectorTests.cs (26)
73Assert.Equal("Exact", pathDictionary[wwwSubdomainOptions.ServerCertificate]); 76Assert.Equal("WildcardPrefix", pathDictionary[baSubdomainOptions.ServerCertificate]); 79Assert.Equal("WildcardPrefix", pathDictionary[aSubdomainOptions.ServerCertificate]); 85Assert.Equal("WildcardOnly", pathDictionary[noSubdomainOptions.ServerCertificate]); 88Assert.Equal("WildcardOnly", pathDictionary[anotherTldOptions.ServerCertificate]); 130Assert.Equal("Long", pathDictionary[baSubdomainOptions.ServerCertificate]); 134Assert.Equal("Short", pathDictionary[aSubdomainOptions.ServerCertificate]); 176Assert.Equal("Exact", pathDictionary[wwwSubdomainOptions.ServerCertificate]); 179Assert.Equal("WildcardPrefix", pathDictionary[baSubdomainOptions.ServerCertificate]); 182Assert.Equal("WildcardPrefix", pathDictionary[aSubdomainOptions.ServerCertificate]); 225Assert.Equal("Exact", pathDictionary[wwwSubdomainOptions.ServerCertificate]); 228Assert.Equal("WildcardPrefix", pathDictionary[baSubdomainOptions.ServerCertificate]); 231Assert.Equal("WildcardPrefix", pathDictionary[aSubdomainOptions.ServerCertificate]); 240var fullChain = fullChainDictionary[aSubdomainOptions.ServerCertificate]; 288Assert.Equal("a", pathDictionary[aSubdomainOptions.ServerCertificate]); 291Assert.Equal("b", pathDictionary[bSubdomainOptions.ServerCertificate]); 381Assert.Equal("WildcardOnly", pathDictionary[options.ServerCertificate]); 487Assert.Same(selectorCertificate, selectorOptions1.ServerCertificate); 490Assert.Same(selectorCertificate, selectorOptions2.ServerCertificate); 496Assert.NotSame(selectorCertificate, configOptions1.ServerCertificate); 499Assert.NotSame(selectorCertificate, configOptions2.ServerCertificate); 546Assert.Same(fallbackOptions.ServerCertificate, options.ServerCertificate); 574Assert.Same(selectorCertificate, options.ServerCertificate); 894Assert.Same(options.ServerCertificate, clonedOptions.ServerCertificate); 895Assert.True(propertyNames.Remove(nameof(options.ServerCertificate)));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicConnectionListener.cs (1)
106if (serverAuthenticationOptions.ServerCertificate == null &&
Internal\QuicLog.cs (1)
200[LoggerMessage(18, LogLevel.Warning, $"{nameof(SslServerAuthenticationOptions)} must provide a server certificate using {nameof(SslServerAuthenticationOptions.ServerCertificate)}," +
System.Net.Quic (3)
System\Net\Quic\Internal\MsQuicConfiguration.cs (3)
107else if (authenticationOptions.ServerCertificate is not null) 109certificate = authenticationOptions.ServerCertificate; 114throw new ArgumentException(SR.Format(SR.net_quic_not_null_ceritifcate, nameof(SslServerAuthenticationOptions.ServerCertificate), nameof(SslServerAuthenticationOptions.ServerCertificateContext), nameof(SslServerAuthenticationOptions.ServerCertificateSelectionCallback)), nameof(options));
System.Net.Security (5)
System\Net\Security\SslAuthenticationOptions.cs (5)
77if (sslServerAuthenticationOptions.ServerCertificate == null && 85if ((sslServerAuthenticationOptions.ServerCertificate != null || 117else if (sslServerAuthenticationOptions.ServerCertificate != null) 119X509Certificate2? certificateWithKey = sslServerAuthenticationOptions.ServerCertificate as X509Certificate2; 132certificateWithKey = SslStream.FindCertificateWithPrivateKey(this, true, sslServerAuthenticationOptions.ServerCertificate);