Acme api v2 for .net

Hello,
I am developing let’s encrypt Free ssl for my my website.
I am using below link :

Code Sample
To create account

   public async Task CreateAccount()
        {
            try
            {
                string path = Server.MapPath("~/cert/Test1.txt");
                var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2);
                var account = await acme.NewAccount("**@gmail.com", true);
                var pemKey = acme.AccountKey.ToPem();
                System.IO.File.WriteAllText(path, pemKey);
            }
            catch (Exception ex)
            {

            }
        }

When i fetch the account details nothing happen.

            string path = Server.MapPath("~/cert/Test1.txt");
            string Privatekey = System.IO.File.ReadAllText(path);

            var accountKey = KeyFactory.FromPem(Privatekey);
                var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2, accountKey);
                var account = await acme.Account();
                var accountInfo = await account.Resource();

After

var account = await acme.Account(); 

this Line nothing happen.

I am trying it on localhost.
Also give guidline that how i test ssl from my localhost.

Thanks in advance

Hi @BijalTest, welcome to the community forum :wave:

I think you'll get better help with this problem if you open an issue on the Certes repository and ask the developers there for help. It's possible that @webprofusion or others familiar with C# and this library will see your post here but it isn't guaranteed :slight_smile:

I'm not familiar with C# or this library but perhaps you should catch exceptions here and see if there are any problems being returned when your account is created.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.