Skip to content

Conversation

@itay-grudev
Copy link

I am having an issue where my request for certificates valid for 336h are only valid for a 7 days.

After a lot of painful digging I found that Cloudflare's API documentation shows that only a subset of values is possible:

7d, 30d, 90d, 365d, 730d, 1095d, 5475d

See requested_validity.

It would have saved me a lot of time if the documentation mentioned it, so here it is for posterity.

@terinjokes
Copy link
Contributor

Can you make this a bulleted list and move to a paragraph underneath the Certificate example? I don't think it needs a section header, especially as it's not a limitation of this project.

I'd also appreciate a squashed commit, since you're already making changes.

@terinjokes
Copy link
Contributor

Also, it's not ignored, we find the closest value locally.

func closest(of int, valid []int) int {
min := math.MaxFloat64
closest := of
for _, v := range valid {
diff := math.Abs(float64(v - of))
if diff < min {
min = diff
closest = v
}
}
return closest
}

@itay-grudev
Copy link
Author

@terinjokes Done.

@terinjokes terinjokes self-assigned this Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants