The challenge may be of different type. Only one of the types is "certificate". Where do you check the type?