It seems serial numbers starting with 80 cause @peculiar/x509 to generate invalid certifiates that Node's TLSSocket then fails to parse, throwing an ERR_OSSL_ASN1_ILLEGAL_PADDING error, so the hack is to generate serial numbers until we get one that doesn't start with 80.
This can be reverted when the upstream issue is fixed.
Change checklist
[x] I have performed a self-review of my own code
[ ] I have made corresponding changes to the documentation if necessary (this includes comments as well)
[ ] I have added tests that prove my fix is effective or that my feature works
This is a hack to work around https://github.com/PeculiarVentures/x509/issues/74 until it is addressed upstream.
It seems serial numbers starting with
80
cause@peculiar/x509
to generate invalid certifiates that Node'sTLSSocket
then fails to parse, throwing anERR_OSSL_ASN1_ILLEGAL_PADDING
error, so the hack is to generate serial numbers until we get one that doesn't start with80
.This can be reverted when the upstream issue is fixed.
Change checklist