Closed rayway30419 closed 8 years ago
That probably means that the topics field of the certificate may contain other values than I expected.
Care to make a PR for the format that your certificate holds?
May I send my certificate by email?
I find the others certifications topic is "$ + bundle_id"
You don’t need to send me your certificate, you can check the value yourself like so:
$ irb -r openssl
irb(main):001:0> cert = OpenSSL::X509::Certificate.new(File.read('/path/to/certificate.pem')); nil
=> nil
irb(main):002:0> cert.extensions.find { |ext| ext.oid == '1.2.840.113635.100.6.3.6' }.value
=> "0d..net.artsy.artsy0...app..net.artsy.artsy.voip0...voip..net.artsy.artsy.complication0...complication"
I got
"0...!com.kdanmobile.ipad.pdfreaderlite0...app.&com.kdanmobile.ipad.pdfreaderlite.voip0...voip..com.kdanmobile.ipad.pdfreaderlite.complication0...complication"
and lowdown default_topic
@default_topic="!com.kdanmobile.ipad.pdfreaderlite"
Interesting, well it’s definitely clear where those !
and &
characters are coming in from. I’m still not sure what they signify and feel like I might be overlooking a proper parser for the format of this value 🤔
But for now it should be easy enough for you to make a PR that adds entries formatted like yours to the tests and then make the parsing work for both cases.
I thought it is not easy to me, but I will give it a try. :(
Hi @alloy,
I find this situation occurs in other certificates, too.
If this parser is only want to grep the bundle id, why not just parse the subject? :(
I've tried to reproduce certifications and using other language to parse it but get the same result.
@rayway30419 The reason that it’s not just the bundle ID is that a universal certificate may be used for more than 1 purpose. I pushed a fix that should be the right fix, let me know if it works for you.
Hi @alloy The fix by ASN1 looks well. I thought you can commit this modification into rubygems. :) thx
Has this fix been released? We are experiencing this error (only in one of our apps).
@alloy can confirm that this is fixed on master, but it doesn't look like it's been released. Fetching from rubygems.org still has the bug.
Hey, just got back from holiday.
My bad, I’ll put out a release this week. Thanks for reminding me.
Hi alloy,
After I user the certificate to establish a lowdown client,
the client's default_topic shows "!xxxxxx". ( '!' + bundle id )
Then when I send push notifications to devices, apns response me 400 with reason "TopicDisallowed".
It happens to 5/32 apps.
Do you have any idea?