Giter Site home page Giter Site logo

Comments (7)

fszlin avatar fszlin commented on September 28, 2024

Not a good message. 😞

I think what happened is acme could not fetch your ACME account by the given key.
Have you done the registration process?

from certes.

koravl avatar koravl commented on September 28, 2024

Yes, registration done. I've fetched sources instead of nuget and found where error happens: in method AcmeHttpClient.Post. Error message is "urn:ietf:params:acme:error:accountDoesNotExist" as you said, but I've registered first and saved pemKey. Then I do following as written in example:

var pemKey = File.ReadAllText("AcmeAccountPemKey.txt");
var accountKey = KeyFactory.FromPem(pemKey);
var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2, accountKey);
var account = acme.Account();
var order = await acme.NewOrder(new[] { "some.domain.net" });

It'd be more convenient if inner exception contained more precize error message, e.g. message from letencrypt.

Now I'll make some expreriments and then will write results.

from certes.

koravl avatar koravl commented on September 28, 2024

In creating account example I made app to wait for end of account creation process and only then save pem to file. After that, error dissapeared. May be it is coincidence, may be not.

var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2);
var account = acme.NewAccount("[email protected]", true).GetAwaiter().GetResult();
var pemKey = acme.AccountKey.ToPem();
File.WriteAllText("AcmeAccountPemKey.txt", pemKey);

I noticed, that requests are processed quite long time, may me acme.AccountKey.ToPem returns before account created with incorrect value?

from certes.

fszlin avatar fszlin commented on September 28, 2024

Yes, you need to wait for the task to complete. If you exit before the task complete, the NewAccount request to Let's Encrypt will get canceled.

It may be better if you do var account = await acme.NewAccount("[email protected]", true);?

from certes.

koravl avatar koravl commented on September 28, 2024

Yes. But to prevent misunderstanding, acme.AccountKey.ToPem() should not return before account created.

from certes.

fszlin avatar fszlin commented on September 28, 2024

I agree with you in this use case. Just in general AcmeContext.AccountKey is the key pair associated with the context, it could be an existing key, new key, or custom key generate by OpenSSL. So, it cannot guarantee a valid and active account exists.

from certes.

stale avatar stale commented on September 28, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from certes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.