Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooling] dotnet dev-certs issues on Mac when old certificate version is present #15118

Closed
javiercn opened this issue Oct 17, 2019 · 10 comments
Closed
Assignees
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI bug This issue describes a behavior which is not expected - a bug. feature-devcerts
Milestone

Comments

@javiercn
Copy link
Member

When an old version of the certificate is present on Mac, the tool runs into some issues:

  • It does not update the cert automatically. dotnet dev-certs https --check returns 0.
  • It causes exporting the certificate to fail dotnet dev-certs https -ep path -p password fails.
  • The old version is not accepted by new OS/Browsers and it causes HTTPS connections to be rejected.

Cleaning the cert and creating a new one fixes the issue.

For whomever is fixing this:

  • First run dotnet dev-certs https -ep cert -path and see if it fails.
  • Create a razor pages app and see if it works (and you can navigate to the https endpoint).
  • DO not run dotnet dev-certs HTTPS --clean as that will remove the cert and prevent the issue from reproing.
    • We want to debug this as we want to know why it is failing and we want to patch it.
@mkArtakMSFT mkArtakMSFT added area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Oct 17, 2019
@mkArtakMSFT mkArtakMSFT added this to the 3.1.0-preview3 milestone Oct 17, 2019
@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. PRI: 1 - Required labels Oct 17, 2019
@javiercn
Copy link
Member Author

I managed to get a clean repro for this issue.

  • On a clean machine (no .NET Core)

  • Install .NET Core 3.0

  • Run dotnet new webapp

  • Run the app with dotnet run

  • Run the app with dotnet path-to-dll

  • Run dotnet dev-certs https -ep ./cert.pfx -p crypticpassword

  • Install .NET Core 3.1

  • Run the app with dotnet run

  • Run the app with dotnet path-to-dll

    • The app fails to access the certificate inside the keychain
  • Run dotnet dev-certs https -ep ./cert.pfx -p crypticpassword

    • The app fails to access the certificate inside the keychain (exception below)
  • Run dotnet dev-certs through dotnet run -- https -ep ./cert.pfx -p crypticpassword

    • The app successfully exports the certificate.
    • This was done cloning the aspnetcore repo.
  • I managed to capture the exception by debugging the current version of the tool.

  • The exception can be found at the bottom.

  • At this point I believe it is an issue in .NET Core 3.1 preview1

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/jacalvar/work/AspNetCore/artifacts/bin/dotnet-dev-certs/Debug/netcoreapp3.1/dotnet-dev-certs.dll'. Symbols loaded.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Diagnostics.Debug.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Diagnostics.Process.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.ComponentModel.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Threading.Thread.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.InteropServices.RuntimeInformation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/Microsoft.Win32.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.X509Certificates.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over non-user code 'Microsoft.AspNetCore.Certificates.Generation.CertificateManager.<>c__DisplayClass46_0..ctor'
The thread 366462 has exited with code 0 (0x0).
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.Encoding.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Memory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Buffers.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.Algorithms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over property 'Microsoft.AspNetCore.Certificates.Generation.CertificateManager.DetailedEnsureCertificateResult.get_Diagnostics'. To step into properties or operators, add '"enableStepFiltering": false' to launch.json and restart debugging.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.IO.FileSystem.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'Interop.AppleCrypto.AppleCommonCryptoCryptographicException' in System.Security.Cryptography.X509Certificates.dll
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.IO.MemoryMappedFiles.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

"Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The user name or passphrase you entered is not correct.\n   at Interop.AppleCrypto.X509Export(X509ContentType contentType, SafeCreateHandle cfPassphrase, IntPtr[] certHandles)\n   at Interop.AppleCrypto.X509ExportPfx(IntPtr[] certHandles, SafePasswordHandle exportPassword)\n   at Internal.Cryptography.Pal.StorePal.AppleCertificateExporter.ExportPkcs12(SafePasswordHandle password)\n   at Internal.Cryptography.Pal.StorePal.AppleCertificateExporter.Export(X509ContentType contentType, SafePasswordHandle password)\n   at Internal.Cryptography.Pal.AppleCertificatePal.Export(X509ContentType contentType, SafePasswordHandle password)\n   at System.Security.Cryptography.X509Certificates.X509Certificate.Export(X509ContentType contentType, String password)\n   at Microsoft.AspNetCore.Certificates.Generation.CertificateManager.ExportCertificate(X509Certificate2 certificate, String path, Boolean includePrivateKey, String password, DiagnosticInformation diagnostics) in /Users/jacalvar/work/AspNetCore/src/Shared/CertificateGeneration/CertificateManager.cs:line 310"

@javiercn
Copy link
Member Author

This also includes the log from kestrel

dotnet ./bin/Debug/netcoreapp3.1/webappclean31.dll

dotnet ./bin/Debug/netcoreapp3.1/webappclean31.dll
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
      Hosting starting
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using '/Users/jacalvar/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-2ba1a4f9-1a74-42f1-9dfc-66d1c8f6477f.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-90369a32-cc7f-4640-a05c-a0ddd5d8ad51.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-8be36a50-36bd-4df5-a019-a07e0660e256.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-1f4045ee-9ee7-4cd4-ac0d-3a87e9e15d0e.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-d8d2bb5d-96cd-4d03-94a4-530255a7633b.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-784f15d0-86f5-4b69-8385-56831915d539.xml'.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {2ba1a4f9-1a74-42f1-9dfc-66d1c8f6477f}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {90369a32-cc7f-4640-a05c-a0ddd5d8ad51}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {8be36a50-36bd-4df5-a019-a07e0660e256}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {1f4045ee-9ee7-4cd4-ac0d-3a87e9e15d0e}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {d8d2bb5d-96cd-4d03-94a4-530255a7633b}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {784f15d0-86f5-4b69-8385-56831915d539}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13]
      Considering key {784f15d0-86f5-4b69-8385-56831915d539} with expiration date 2019-11-15 14:03:22Z as default key.
dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0]
      Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11]
      Using managed symmetric algorithm 'System.Security.Cryptography.Aes'.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10]
      Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2]
      Using key {784f15d0-86f5-4b69-8385-56831915d539} as the default key.
dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionHostedService[0]
      Key ring with default key {784f15d0-86f5-4b69-8385-56831915d539} was loaded during application startup.
dbug: Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer[2]
      Failed to locate the development https certificate at '(null)'.
dbug: Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer[0]
      Using development certificate: CN=localhost (Thumbprint: 163AB9BC6FB63A5504E690BC3603E0931557FCD8)
dbug: Microsoft.AspNetCore.Server.Kestrel[0]
      No listening endpoints were configured. Binding to http://localhost:5000 and https://localhost:5001 by default.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
dbug: Microsoft.AspNetCore.Hosting.Diagnostics[0]
      Loaded hosting startup assembly webappclean31
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/jacalvar/work/validation/webappclean31
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
      Hosting started
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPMSPDN1D" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPMSPDN1D" started.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:5000/  
dbug: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[0]
      Wildcard detected, all requests with hosts will be allowed.
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
dbug: Microsoft.AspNetCore.HttpsPolicy.HstsMiddleware[1]
      The request is insecure. Skipping HSTS header.
dbug: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[5]
      Https port '5001' discovered from server endpoints.
dbug: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[1]
      Redirecting to 'https://localhost:5001/'.
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPMSPDN1D" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 13.8035ms 307 
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPMSPDN1E" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPMSPDN1E" started.
dbug: Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware[1]
      Failed to authenticate HTTPS connection.
System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
 ---> Interop+AppleCrypto+SslException: Internal error
   --- End of inner exception stack trace ---
   at System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
   at System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ProcessAuthentication(LazyAsyncResult lazyResult, CancellationToken cancellationToken)
   at System.Net.Security.SslStream.BeginAuthenticateAsServer(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsServerAsync>b__69_0(SslServerAuthenticationOptions arg1, CancellationToken arg2, AsyncCallback callback, Object state)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2](Func`5 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state)
   at System.Net.Security.SslStream.AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware.InnerOnConnectionAsync(ConnectionContext context)
dbug: Microsoft.AspNetCore.Server.Kestrel[2]
      Connection id "0HLQJPMSPDN1E" stopped.
dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[7]
      Connection id "0HLQJPMSPDN1E" sending FIN because: "The Socket transport's send loop completed gracefully."

dotnet run

dotnet run
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
      Hosting starting
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using '/Users/jacalvar/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-2ba1a4f9-1a74-42f1-9dfc-66d1c8f6477f.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-90369a32-cc7f-4640-a05c-a0ddd5d8ad51.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-8be36a50-36bd-4df5-a019-a07e0660e256.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-1f4045ee-9ee7-4cd4-ac0d-3a87e9e15d0e.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-d8d2bb5d-96cd-4d03-94a4-530255a7633b.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file '/Users/jacalvar/.aspnet/DataProtection-Keys/key-784f15d0-86f5-4b69-8385-56831915d539.xml'.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {2ba1a4f9-1a74-42f1-9dfc-66d1c8f6477f}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {90369a32-cc7f-4640-a05c-a0ddd5d8ad51}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {8be36a50-36bd-4df5-a019-a07e0660e256}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {1f4045ee-9ee7-4cd4-ac0d-3a87e9e15d0e}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {d8d2bb5d-96cd-4d03-94a4-530255a7633b}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {784f15d0-86f5-4b69-8385-56831915d539}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13]
      Considering key {784f15d0-86f5-4b69-8385-56831915d539} with expiration date 2019-11-15 14:03:22Z as default key.
dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0]
      Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11]
      Using managed symmetric algorithm 'System.Security.Cryptography.Aes'.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10]
      Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2]
      Using key {784f15d0-86f5-4b69-8385-56831915d539} as the default key.
dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionHostedService[0]
      Key ring with default key {784f15d0-86f5-4b69-8385-56831915d539} was loaded during application startup.
dbug: Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer[2]
      Failed to locate the development https certificate at '(null)'.
dbug: Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer[0]
      Using development certificate: CN=localhost (Thumbprint: 163AB9BC6FB63A5504E690BC3603E0931557FCD8)
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
dbug: Microsoft.AspNetCore.Hosting.Diagnostics[0]
      Loaded hosting startup assembly webappclean31
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/jacalvar/work/validation/webappclean31
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
      Hosting started
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPNJM1BN5" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPNJM1BN5" started.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:5000/  
dbug: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[0]
      Wildcard detected, all requests with hosts will be allowed.
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
dbug: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[5]
      Https port '5001' discovered from server endpoints.
dbug: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[1]
      Redirecting to 'https://localhost:5001/'.
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN5" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 16.4956ms 307 
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPNJM1BN6" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPNJM1BN6" started.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[4]
      The request path / does not match a supported file type
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/Error.cshtml'.
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/Index.cshtml'.
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/Privacy.cshtml'.
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/Shared/_Layout.cshtml'.
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/Shared/_ValidationScriptsPartial.cshtml'.
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/_ViewImports.cshtml'.
dbug: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[3]
      Initializing Razor view compiler with compiled view: '/Pages/_ViewStart.cshtml'.
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1001]
      1 candidate(s) found for the request path '/'
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1005]
      Endpoint 'Page: /Index' with route pattern '' is valid for the request path '/'
trce: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[5]
      Located compiled view for view at path '/Pages/Index.cshtml'.
dbug: Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware[1]
      Request matched endpoint '/Index'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/Index'
dbug: Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderFactory[12]
      Registered model binder providers, in the following order: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ServicesModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.HeaderModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FloatingPointTypeModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.EnumTypeModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.SimpleTypeModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CancellationTokenModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ByteArrayModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FormFileModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.FormCollectionModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.KeyValuePairModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ArrayModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinderProvider, Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider
trce: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[5]
      Located compiled view for view at path '/Pages/_ViewStart.cshtml'.
trce: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[7]
      Could not find a file for view at path '/_ViewStart.cshtml'.
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Route matched with {page = "/Index"}. Executing page /Index
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Execution plan of authorization filters (in the following order): Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Execution plan of resource filters (in the following order): Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Execution plan of action filters (in the following order): Microsoft.AspNetCore.Mvc.ModelBinding.UnsupportedContentTypeFilter (Order: -3000)
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Execution plan of exception filters (in the following order): None
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Execution plan of result filters (in the following order): Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Authorization Filter: Before executing OnAuthorizationAsync on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Authorization Filter: After executing OnAuthorizationAsync on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Resource Filter: Before executing OnResourceExecuting on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Resource Filter: After executing OnResourceExecuting on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[101]
      Executing page model factory for page webappclean31.Pages.Pages_Index (webappclean31.Views)
dbug: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[102]
      Executed page model factory for page webappclean31.Pages.Pages_Index (webappclean31.Views)
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Page Filter: Before executing OnPageHandlerSelectionAsync on filter Microsoft.AspNetCore.Mvc.Filters.PageHandlerPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Page Filter: After executing OnPageHandlerSelectionAsync on filter Microsoft.AspNetCore.Mvc.Filters.PageHandlerPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Page Filter: Before executing OnPageHandlerSelected on filter Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandleOptionsRequestsPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Page Filter: Before executing OnPageHandlerExecutionAsync on filter Microsoft.AspNetCore.Mvc.Filters.PageHandlerPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Page Filter: Before executing OnPageHandlerExecuting on filter Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandleOptionsRequestsPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Page Filter: After executing OnPageHandlerExecuting on filter Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandleOptionsRequestsPageFilter.
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[101]
      Executing handler method webappclean31.Pages.IndexModel.OnGet - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[102]
      Executed handler method OnGet, returned result .
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[103]
      Executing an implicit handler method - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[104]
      Executed an implicit handler method, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[1]
      Page Filter: Before executing OnPageHandlerExecuted on filter Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandleOptionsRequestsPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Page Filter: After executing OnPageHandlerExecuted on filter Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.HandleOptionsRequestsPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Page Filter: After executing OnPageHandlerExecutionAsync on filter Microsoft.AspNetCore.Mvc.Filters.PageHandlerPageFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Result Filter: Before executing OnResultExecuting on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Result Filter: After executing OnResultExecuting on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[4]
      Before executing action result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
dbug: Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine[1]
      View lookup cache miss for view '_Layout' in controller '(null)'.
trce: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[7]
      Could not find a file for view at path '/Pages/_Layout.cshtml'.
trce: Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultViewCompiler[5]
      Located compiled view for view at path '/Pages/Shared/_Layout.cshtml'.
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[100]
      Found the endpoints Page: /Index for address Microsoft.AspNetCore.Routing.RouteValuesAddress
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[102]
      Successfully processed template  for Page: /Index resulting in  and 
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[105]
      Link generation succeeded for endpoints Page: /Index with result /
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[100]
      Found the endpoints Page: /Index for address Microsoft.AspNetCore.Routing.RouteValuesAddress
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[102]
      Successfully processed template  for Page: /Index resulting in  and 
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[105]
      Link generation succeeded for endpoints Page: /Index with result /
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[100]
      Found the endpoints Page: /Privacy for address Microsoft.AspNetCore.Routing.RouteValuesAddress
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[102]
      Successfully processed template Privacy for Page: /Privacy resulting in /Privacy and 
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[105]
      Link generation succeeded for endpoints Page: /Privacy with result /Privacy
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[100]
      Found the endpoints Page: /Privacy for address Microsoft.AspNetCore.Routing.RouteValuesAddress
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[102]
      Successfully processed template Privacy for Page: /Privacy resulting in /Privacy and 
dbug: Microsoft.AspNetCore.Routing.DefaultLinkGenerator[105]
      Link generation succeeded for endpoints Page: /Privacy with result /Privacy
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[5]
      After executing action result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Result Filter: Before executing OnResultExecuted on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Result Filter: After executing OnResultExecuted on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[2]
      Resource Filter: Before executing OnResourceExecuted on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
trce: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Resource Filter: After executing OnResourceExecuted on filter Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.SaveTempDataFilter.
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[4]
      Executed page /Index in 170.9765ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/Index'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN6" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 328.3339ms 200 text/html; charset=utf-8
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPNJM1BN7" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPNJM1BN7" started.
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPNJM1BN8" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPNJM1BN8" started.
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPNJM1BN9" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[39]
      Connection id "0HLQJPNJM1BNA" accepted.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPNJM1BN9" started.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/lib/bootstrap/dist/css/bootstrap.min.css  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
trce: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[0]
      Range header's value is empty.
dbug: Microsoft.AspNetCore.Server.Kestrel[1]
      Connection id "0HLQJPNJM1BNA" started.
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/bootstrap/dist/css/bootstrap.min.css'. Physical path: '/Users/jacalvar/work/validation/webappclean31/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN6" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 56.0355ms 200 text/css
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/css/site.css  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
trce: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[0]
      Range header's value is empty.
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/css/site.css'. Physical path: '/Users/jacalvar/work/validation/webappclean31/wwwroot/css/site.css'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN7" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 0.5293ms 200 text/css
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/lib/jquery/dist/jquery.min.js  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
trce: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[0]
      Range header's value is empty.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/lib/bootstrap/dist/js/bootstrap.bundle.min.js  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
trce: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[0]
      Range header's value is empty.
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/jquery/dist/jquery.min.js'. Physical path: '/Users/jacalvar/work/validation/webappclean31/wwwroot/lib/jquery/dist/jquery.min.js'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN6" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 4.2159ms 200 application/javascript
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/lib/bootstrap/dist/js/bootstrap.bundle.min.js'. Physical path: '/Users/jacalvar/work/validation/webappclean31/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN7" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 2.4162ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/js/site.js?v=dLGP40S79Xnx6GqUthRF6NWvjvhQ1nOvdVSwaNcgG18  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
trce: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[0]
      Range header's value is empty.
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/js/site.js'. Physical path: '/Users/jacalvar/work/validation/webappclean31/wwwroot/js/site.js'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN7" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 0.2242ms 200 application/javascript
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/favicon.ico  
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
trce: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[0]
      Range header's value is empty.
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/favicon.ico'. Physical path: '/Users/jacalvar/work/validation/webappclean31/wwwroot/favicon.ico'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HLQJPNJM1BN7" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 1.2431ms 200 image/x-icon

dev-certs export exception

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/jacalvar/work/AspNetCore/artifacts/bin/dotnet-dev-certs/Debug/netcoreapp3.1/dotnet-dev-certs.dll'. Symbols loaded.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Diagnostics.Debug.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Diagnostics.Process.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.ComponentModel.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Threading.Thread.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.InteropServices.RuntimeInformation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/Microsoft.Win32.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.X509Certificates.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over non-user code 'Microsoft.AspNetCore.Certificates.Generation.CertificateManager.<>c__DisplayClass46_0..ctor'
The thread 366462 has exited with code 0 (0x0).
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.Encoding.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Runtime.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Memory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Buffers.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Security.Cryptography.Algorithms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over property 'Microsoft.AspNetCore.Certificates.Generation.CertificateManager.DetailedEnsureCertificateResult.get_Diagnostics'. To step into properties or operators, add '"enableStepFiltering": false' to launch.json and restart debugging.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.IO.FileSystem.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'Interop.AppleCrypto.AppleCommonCryptoCryptographicException' in System.Security.Cryptography.X509Certificates.dll
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.0-preview1.19506.1/System.IO.MemoryMappedFiles.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
e.ToString()
"Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The user name or passphrase you entered is not correct.\n   at Interop.AppleCrypto.X509Export(X509ContentType contentType, SafeCreateHandle cfPassphrase, IntPtr[] certHandles)\n   at Interop.AppleCrypto.X509ExportPfx(IntPtr[] certHandles, SafePasswordHandle exportPassword)\n   at Internal.Cryptography.Pal.StorePal.AppleCertificateExporter.ExportPkcs12(SafePasswordHandle password)\n   at Internal.Cryptography.Pal.StorePal.AppleCertificateExporter.Export(X509ContentType contentType, SafePasswordHandle password)\n   at Internal.Cryptography.Pal.AppleCertificatePal.Export(X509ContentType contentType, SafePasswordHandle password)\n   at System.Security.Cryptography.X509Certificates.X509Certificate.Export(X509ContentType contentType, String password)\n   at Microsoft.AspNetCore.Certificates.Generation.CertificateManager.ExportCertificate(X509Certificate2 certificate, String path, Boolean includePrivateKey, String password, DiagnosticInformation diagnostics) in /Users/jacalvar/work/AspNetCore/src/Shared/CertificateGeneration/CertificateManager.cs:line 310"

@mrward
Copy link
Contributor

mrward commented Oct 22, 2019

Repro steps on macOS 10.14.6:

  • Uninstall .NET core sdks - Use https://github.com/dotnet/cli/blob/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh
  • Delete localhost certificates from KeyChain
  • Install .NET Core 3.0.100 SDK
  • dotnet new webapp
  • dotnet build
  • dotnet run will fail since there are no certs
  • dotnet bin/Debug/netcoreapp30/test.dll will run on http not https
  • export ASPNETCORE_URLS="https://localhost:5001;http://localhost:5000"
  • dotnet bin/Debug/netcore30/test.dll will fail since there are no certs
  • dotnet dev-certs https --trust
  • dotnet bin/Debug/netcoreapp30/test.dll now works - https://localhost:5001 can be opened in browser
  • Install .NET Core 3.1 preview 1 dotnet-sdk-3.1.100-preview1-014459-osx-x64
  • dotnet bin/Debug/netcoreapp30/test.dll Cannot open https://localhost:5001 in browser

This machine is not a clean machine. It has had other .NET Core sdks installed

Debugging this in VS Mac:

Exception thrown: 'System.DllNotFoundException' in Microsoft.AspNetCore.Cryptography.Internal.dll

Errors after: Now listening on: https://localhost:5001

VS Mac is trying to connect to the localhost port here:

Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Net.Security.dll
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Net.Sockets.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll

@javiercn
Copy link
Member Author

Exception thrown: 'System.DllNotFoundException' in Microsoft.AspNetCore.Cryptography.Internal.dll

This issue seems unrelated and like based on some state on the machine. I haven't experienced it.

I think the repro can be simplified.

  • Install 3.0. Make sure the first run experience runs and there is a certificate in the key chain.
  • Run dotnet dev-certs https -ep ./cert30.pfx -p password
  • Install 3.1 (doesn't matter if the first run experience runs).
  • Run dotnet dev-certs https -ep ./cert31.pfx -p password

I have a hunch that the two exceptions happen for the same reason (both cases fail when they try to access the key material), so using this simplified repro might be an easier way to investigate.

@wfurt
Copy link
Member

wfurt commented Oct 22, 2019

I could not reproduce it neither on 10.14 nor on 10.15.
I did several different variations including upgrade from 10.14 -> 10.15 and it works as expected

Tomass-Mac:Downloads furt$ ~/dotnet-3.1-preview1/dotnet dev-certs https -ep ./cert31.pfx -p password
A valid HTTPS certificate is already present.

Tomass-Mac:Downloads furt$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15
BuildVersion:	19A603
Tomass-Mac:Downloads furt$ csrutil  status
System Integrity Protection status: enabled.

I think there is something about how we install or consume dotnet or it is related to some system configuration or state. The system I'm using has default configuration. Installed 10.14.6 and then I did upgrade to 10.15. I don't know if it matters to use installer or just binaries. The symptoms @mrward is reporting looks like some corrupted install.

@javiercn
Copy link
Member Author

@wfurt Thanks for looking into this. I haven't changed anything on the Mac configuration I'm using. Is there anything I can run on my machine that would give you more details?

@javiercn
Copy link
Member Author

I ran sw_vers and csrutil status and the only difference I find on my machine is that the build number says its BuildVersion: 19A602.

I've checked for updates and the OS says it's up to date

@wfurt
Copy link
Member

wfurt commented Oct 22, 2019

There are few things you can try to get some more info.
Find PID for securityd and run before export.

 log stream --process <PID>

(you can skip PID but that may be noisy. Check if you see anything interesting there.

run before trying export.
security unlock-keychain

Disable temporarily extended security (needs to be done from recovery mode)
csrutil disable

@Pilchie
Copy link
Member

Pilchie commented Jan 27, 2020

Clearing milestone for re-triage

@mkArtakMSFT
Copy link
Member

@javiercn is this still a concern?

@ghost ghost locked as resolved and limited conversation to collaborators Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI bug This issue describes a behavior which is not expected - a bug. feature-devcerts
Projects
None yet
Development

No branches or pull requests

6 participants