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

Intermediate cert #44

Closed
hognevevle opened this issue Jun 17, 2020 · 1 comment
Closed

Intermediate cert #44

hognevevle opened this issue Jun 17, 2020 · 1 comment

Comments

@hognevevle
Copy link

I'm experiencing a weird issue where in the example app, GetAsync(order.Payload.Certificate) will give me a PEM containing both the domain cert and the intermediate cert. However, in my real app, where I consume the ACMESharp nuget package, the PEM does not contain the intermediate cert. I might be missing something, but it seems really weird.

Does the payload from the ACME API contain both certs, or is there some special work being done inside ACMESharp in this area?

@hognevevle
Copy link
Author

hognevevle commented Jun 19, 2020

I definitely missed something :)

In my real app, I was doing the following:

                    var certBytes = await certResp.Content.ReadAsByteArrayAsync();

                    using (var x509Cert = new X509Certificate2(certBytes))
                    {
                        var pkiCert = PkiCertificate.From(x509Cert);

                        var certBuf = pkiCert.Export(PkiEncodingFormat.Pem);
                        var certString = Encoding.ASCII.GetString(certBuf);

                        [...] (At this point I was expecting to see the intermediate inside certString)
                    }

In this process, the intermediate cert was discarded. I see now, however, that it's indeed present in the ACME server response. so I need to go about this differently.

PEBCAK :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant