Convert x509 selftests to internal test