For the last day I've been unable to connect the the APNS sandbox from my java server. The error I'm getting is
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Certificate chaining errorI've debugged the code, and it boils down to some canonical domain name not matching with something in my certificate:
One looks like this:
cn=entrust.net certification authority (2048),ou=(c) 1999 entrust.net limited,ou=#14377777772e656e74727573742e6e65742f4350535f3230343820696e636f72702e206279207265662e20286c696d697473206c6961622e29,o=entrust.netAnd the other like this:
cn=entrust certification authority - l1k,ou=(c) 2012 entrust\, inc. - for authorized use only,ou=see www.entrust.net/legal-terms,o=entrust\, inc.,c=us... and apparenty they should match.
I've regenterated my p12 files, and my provisioning profiles and pretty much everything else I could think of and still no luck.
If I run and connect to production APNS and look at the corresponding value in the debugger its this (and it's not crashing):
cn=entrust certification authority - l1c,ou=(c) 2009 entrust\, inc.,ou=www.entrust.net/rpa is incorporated by reference,o=entrust\, inc.,c=us