natemcmaster / LettuceEncrypt

Free, automatic HTTPS certificate generation for ASP.NET Core web apps
https://nuget.org/packages/LettuceEncrypt
Apache License 2.0
1.55k stars 153 forks source link

NullReferenceException @ LettuceEncrypt.Internal.AcmeClient.GetOrderAuthorizations(IOrderContext orderContext) #232

Closed petre-c closed 1 year ago

petre-c commented 2 years ago

Here's the exception from my dockerized blazor server app:

blazor        | [08:03:50 INF] Creating new account for [email.address]
blazor        | [08:03:52 INF] Using account 294704460
blazor        | [08:03:52 INF] Creating certificate for [domain]
blazor        | [08:03:58 ERR] Failed to automatically create a certificate for [domain]
blazor        | System.NullReferenceException: Object reference not set to an instance of an object.
blazor        |    at Certes.Acme.OrderContext.Authorizations()
blazor        |    at LettuceEncrypt.Internal.AcmeClient.GetOrderAuthorizations(IOrderContext orderContext)
blazor        |    at LettuceEncrypt.Internal.AcmeCertificateFactory.CreateCertificateAsync(CancellationToken cancellationToken)
blazor        |    at LettuceEncrypt.Internal.AcmeStates.BeginCertificateCreationState.MoveNextAsync(CancellationToken cancellationToken)
blazor        | [08:03:58 ERR] ACME state machine encountered unhandled error
blazor        | System.NullReferenceException: Object reference not set to an instance of an object.
blazor        |    at Certes.Acme.OrderContext.Authorizations()
blazor        |    at LettuceEncrypt.Internal.AcmeClient.GetOrderAuthorizations(IOrderContext orderContext)
blazor        |    at LettuceEncrypt.Internal.AcmeCertificateFactory.CreateCertificateAsync(CancellationToken cancellationToken)
blazor        |    at LettuceEncrypt.Internal.AcmeStates.BeginCertificateCreationState.MoveNextAsync(CancellationToken cancellationToken)
blazor        |    at LettuceEncrypt.Internal.AcmeCertificateLoader.ExecuteAsync(CancellationToken stoppingToken)

These are the configuration options:

appsettings.json

"LettuceEncrypt": {
    "AcceptTermsOfService": true,
    "DomainNames": [ "[domain]" ],
    "EmailAddress": "[email.address]"
  }

Startup.cs

services.AddLettuceEncrypt();
natemcmaster commented 1 year ago

I'm unable to reproduce the problem with the information provided. Please provide more steps to recreate this problem.

petre-c commented 1 year ago

Hey @natemcmaster. It's been a while since I opened this issue, I can't reproduce the issue either.

Happy new year, mate 🎄