natemcmaster / LettuceEncrypt

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

Support EAB (External Account Binding) account credentials #251

Closed bugproof closed 2 years ago

bugproof commented 2 years ago

There is no way to use it with ZeroSSL's ACME server

fail: LettuceEncrypt.Internal.AcmeCertificateLoader[0]
      ACME state machine encountered unhandled error
      Certes.AcmeRequestException: Fail to load resource from 'https://acme.zerossl.com/v2/DV90/newAccount'.
urn:ietf:params:acme:error:externalAccountRequired: The request must include a value for the "externalAccountBinding" field
         at Certes.Acme.IAcmeHttpClientExtensions.Post[T](IAcmeHttpClient client, Uri uri, Object payload, Boolean ensureSuccessStatusCode)
         at Certes.Acme.AccountContext.NewAccount(IAcmeContext context, Account body, Boolean ensureSuccessStatusCode)
         at Certes.AcmeContext.NewAccount(IList`1 contact, Boolean termsOfServiceAgreed)
         at LettuceEncrypt.Internal.AcmeClient.CreateAccountAsync(String emailAddress)
         at LettuceEncrypt.Internal.AcmeCertificateFactory.CreateAccount(CancellationToken cancellationToken)
         at LettuceEncrypt.Internal.AcmeCertificateFactory.GetOrCreateAccountAsync(CancellationToken cancellationToken)
         at LettuceEncrypt.Internal.AcmeStates.BeginCertificateCreationState.MoveNextAsync(CancellationToken cancellationToken)
         at LettuceEncrypt.Internal.AcmeCertificateLoader.ExecuteAsync(CancellationToken stoppingToken)

image

Certes supports this

https://github.com/fszlin/certes/blob/08bf850bbed9e026c718f56f1bcc454afafb4f92/src/Certes/Acme/Resource/Account.cs#L50

so it's on LettuceEncrypt end

https://github.com/natemcmaster/LettuceEncrypt/blob/ffbd458c4ce030b7fdfb5b024daa7845687afc5c/src/LettuceEncrypt/Internal/AcmeClient.cs#L35