-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Android: order is valid however certificate chain is not correctly downloaded #127
Comments
Hi Niels! What CA are you connecting to? When you paste the URL in a browser, the certificate is fetched via It sounds to me like the CA does not support POST-as-GET requests for fetching certificates. However there should still be a If you enable |
Hi @shred, Thanks for the quick response, its connecting to a modified Boulder CA. I'll try and check if that supports "POST-as-GET". But there is no I'll try and figure out how to enable debug logging for Acme4j, I'm using it in an Android application. |
If it's a Boulder CA, I am confident that POST-as-GET should work there. That doesn't seem to be the problem. You are the first one I know who is using acme4j on Android. I have never really tested the code against the Android API, so maybe it's related to that. I had to introduce the Can you compile acme4j locally? Then could you just remove the To get the debug output to logcat, you might need something like |
There's a first for everything! If you could provide a jar that would be great, I will test it asap. Might be the Android implementation indeed. |
Here it is: acme4j-client-2.13-SNAPSHOT.zip GitHub does not support the upload of jar files, so I had to rename it. Just rename it back from I have removed the
|
Thanks for the .jar! I've included your changes and am successfully able to debug the new code as well. It did not fix the issue though.
Still returns an empty list unfortunately so the The file has no extension and has the following format:
It has newline breaks after each certificate, maybe that could be the issue. Do you know if this format is up to spec with the RFC? Looking at the specs I see their example not using line breaks. And I did find this: https://stackoverflow.com/questions/48083276/reading-data-in-a-pem-certificate-chain/50029488 However that seems to be a slightly different problem because for them In any case: thanks for the help so far, I'll try and see if I can think of something else that could be the problem. |
The problem with the empty line sounds familiar, see issue #60. This is why I added the This is a version with the same debug output, but the I will also do some checks with Android and Please keep me updated. If I can assist you, just let me know. |
Unfortunately that doesn't change anything. It's definitely related to some kind of whitespace,
results in 2 certificates.
Results in one certificate.
Results in no certificates. I have tried wrapping the original |
So either my |
Might be that the Android implementation (which I believe is using https://github.com/google/conscrypt) does not like a
Also results in no certificates, so the
docs of Anyway the whole thing is kind of suspect since according to RFC 7468 clearly states:
But as you said IBM's JVM did not do that correctly either. |
Yes, In this test version, all heading and trailing line breaks are trimmed: acme4j-client-2.13-SNAPSHOT.zip The line breaks are now at the bare minimum. Does it work? 😃 |
Wish I had better news.. zero certificates. Must be something else then. |
I guess I have found the problem. Conscrypt's For acme4j I have added a workaround that uses a |
@shred sorry for the delay, coincidentally we have some issues with our CA which makes it not possible for me to test right now. If it is fixed I will delete this comment and post my findings :) Thanks for diving in this issue by the way! |
Thank you for reporting this issue, @NielsMasdorp! Now I know that there is a use case for acme4j on Android, and that it is (hopefully) also working there. 😃 As soon as you confirm that the bug is fixed for you, I will push a new release to Maven Central. |
I unintentionally closed this issue by pushing a fix to the main branch. I am still interested in your feedback! If the issue isn't resolved for you, please reopen. I will release a new version as soon as you confirm it's fixed for you,. |
No worries! Rest assured I will update you. Kind of ashamed the backend team is taking this long, but I should be able to test on monday. Have a nice weekend! |
@shred I can confirm the problem is solved on my end! ACME4J is functional on Android. |
Thank you for reporting back! I have just published the fix in acme4j v2.13. It's available in the release section, and should be available on Maven Central in the next couple of hours. |
Hi!
My
Order.status
is valid and the resultingCertificate
returns the correct URI fromgetLocation()
, when I paste the URL in chrome the PEM chain is correctly dowloaded.However in my code
certificate.getCertificate()
is supposed to load the x.509 certificate but doesn't. It attempts to download the chain vialazyDownload()
no errors are thrown whilst downloading but the resultingcertChain
stays empty socertChain.get(0)
crashes. Any idea's? Might have something to do withTrimmingInputStream
sinceread()
is never called afterCertificateFactory.generateCertificates(in)
.Regards
The text was updated successfully, but these errors were encountered: