Check and fix wrong x509 version field.

This fixes #11653.
Merge pull request #13874 from makinacorpus/ssl

Check and fix wrong x509 version field.