add ssl error check in apns connection