Skip to content

Commit 0270a6e

Browse files
[release/10.0] Add loopback addresses to the development certificate (#64584)
* Add loopback addresses to development certificate * Add using statement * Delete src/Shared/Shared.sln --------- Co-authored-by: David Negstad <David.Negstad@microsoft.com> Co-authored-by: David Negstad <50252651+danegsta@users.noreply.github.com>
1 parent c1b0b62 commit 0270a6e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Shared/CertificateGeneration/CertificateManager.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Diagnostics.CodeAnalysis;
66
using System.Diagnostics.Tracing;
77
using System.Linq;
8+
using System.Net;
89
using System.Runtime.InteropServices;
910
using System.Security.Cryptography;
1011
using System.Security.Cryptography.X509Certificates;
@@ -19,8 +20,8 @@ namespace Microsoft.AspNetCore.Certificates.Generation;
1920

2021
internal abstract class CertificateManager
2122
{
22-
internal const int CurrentAspNetCoreCertificateVersion = 5;
23-
internal const int CurrentMinimumAspNetCoreCertificateVersion = 5;
23+
internal const int CurrentAspNetCoreCertificateVersion = 6;
24+
internal const int CurrentMinimumAspNetCoreCertificateVersion = 6;
2425

2526
// OID used for HTTPS certs
2627
internal const string AspNetHttpsOid = "1.3.6.1.4.1.311.84.1.1";
@@ -697,6 +698,8 @@ internal X509Certificate2 CreateAspNetCoreHttpsDevelopmentCertificate(DateTimeOf
697698
sanBuilder.AddDnsName(InternalWildcardHttpsDnsName);
698699
sanBuilder.AddDnsName(LocalhostDockerHttpsDnsName);
699700
sanBuilder.AddDnsName(ContainersDockerHttpsDnsName);
701+
sanBuilder.AddIpAddress(IPAddress.Loopback);
702+
sanBuilder.AddIpAddress(IPAddress.IPv6Loopback);
700703

701704
var keyUsage = new X509KeyUsageExtension(X509KeyUsageFlags.KeyEncipherment | X509KeyUsageFlags.DigitalSignature, critical: true);
702705
var enhancedKeyUsage = new X509EnhancedKeyUsageExtension(

0 commit comments

Comments
 (0)