@rfc2822 I can’t recreate your problem (my connection succeeds at first try, both on my phone and in the emulator). Is it consistent? Could it be something to do with the specific certificate or with the server configuration? (I’m also testing against apache mod_ssl)
After the force-stop, you may have created some problem in the memorizingtrustmanager’s database. We should probably add an option to delete the database, both as a last resort to handle problems like this and to allow a simple reset of the stored certificates (this can be done simply by deleting the app_KeyStore/KeyStore.bks file)
Regarding issue (3), I may have put the context setting in the wrong places: I modified AccountAuthenticatorService, AddAccountActivity, CalendarsSyncAdapterService and ContactsSyncAdapterService. Should it be in DavSyncAdapter too (or only)?
For testing the popup during a sync, is there an easy way to cause a sync without going through the main activity? (e.g., if I start the sync from the account settings page, is that in the main activity?) By erasing the KeyStore.bks file, you can simulate a certificate change without actually having to reconfigure the web server; I tested this and did get the memorizingtrustmanager popup.