X509 vfy continued

Builds on @lvh's work in #1156. Let's see if jenkins is okay with it.