Skip to content

Commit 00e1b41

Browse files
committed
Remove the friendly name on non-windows OS
1 parent df86b35 commit 00e1b41

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Shared/CertificateGeneration/CertificateManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ internal X509Certificate2 CreateSelfSignedCertificate(
495495
}
496496

497497
var result = request.CreateSelfSigned(notBefore, notAfter);
498-
result.FriendlyName = AspNetHttpsOidFriendlyName;
499498
return result;
500499

501500
RSA CreateKeyMaterial(int minimumKeySize)

src/Shared/CertificateGeneration/WindowsCertificateManager.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@ internal override void CorrectCertificateState(X509Certificate2 candidate)
4646

4747
protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate)
4848
{
49-
var name = StoreName.My;
50-
var location = StoreLocation.CurrentUser;
51-
5249
// On non OSX systems we need to export the certificate and import it so that the transient
5350
// key that we generated gets persisted.
5451
var export = certificate.Export(X509ContentType.Pkcs12, "");
5552
certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
5653
Array.Clear(export, 0, export.Length);
57-
certificate.FriendlyName = certificate.FriendlyName;
54+
certificate.FriendlyName = AspNetHttpsOidFriendlyName;
5855

59-
using (var store = new X509Store(name, location))
56+
using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
6057
{
6158
store.Open(OpenFlags.ReadWrite);
6259
store.Add(certificate);

0 commit comments

Comments
 (0)