Check and fix wrong x509 version field.

This fixes #11653.