Support the new `x509.Certificate.Policies` field
From Go 1.22 changelog:
A new type,
OID, supports ASN.1 Object Identifiers with individual components larger than 31 bits. A new field which uses this type,Policies, is added to theCertificatestruct, and is now populated during parsing. Any OIDs which cannot be represented using aasn1.ObjectIdentifierwill appear inPolicies, but not in the oldPolicyIdentifiersfield. When callingCreateCertificate, thePoliciesfield is ignored, and policies are taken from thePolicyIdentifiersfield. Using thex509usepolicies=1 GODEBUGsetting inverts this, populating certificate policies from thePoliciesfield, and ignoring thePolicyIdentifiersfield. We may change the default value ofx509usepoliciesin Go 1.23, makingPoliciesthe default field for marshaling.
And there is a commit https://github.com/golang/go/commit/918765b619b87a603c40b331bd5f5e2335d265f0 already in Go 1.24 RC1 that changes to use Policies field by default.