Utility provider that works with Transport Layer Security keys and certificates. It provides resources that allow private keys, certificates and certficate requests to be created as part of a Terraform deployment.
There should have been a validity error thrown because 2562048 in hours is too big to fit in a time.Duration type.
Actual Behavior
The value overflowed and became negative leading to a NotAfter date before the Not Before date.
WARNING: could not validate bounds for certificate CA: the certificate has expired: NotBefore: 2024-09-13 09:51:20 +0000 UTC, NotAfter: 1732-06-04 10:16:46 +0000 UTC
Terraform CLI and Provider Versions
$ terraform version Terraform v1.3.6 on linux_amd64
Terraform Configuration
Expected Behavior
There should have been a validity error thrown because 2562048 in hours is too big to fit in a time.Duration type.
Actual Behavior
The value overflowed and became negative leading to a NotAfter date before the Not Before date.
WARNING: could not validate bounds for certificate CA: the certificate has expired: NotBefore: 2024-09-13 09:51:20 +0000 UTC, NotAfter: 1732-06-04 10:16:46 +0000 UTC
Steps to Reproduce
terraform apply
How much impact is this issue causing?
Low
Logs
No response
Additional Information
The calculation is at https://github.com/hashicorp/terraform-provider-tls/blob/6a386292e0f73c5156ab1ab0c9aac41ce248e6dc/internal/provider/common_cert.go#L126
Missing validity check at https://github.com/hashicorp/terraform-provider-tls/blob/6a386292e0f73c5156ab1ab0c9aac41ce248e6dc/internal/provider/resource_self_signed_cert.go#L68
Code of Conduct