Comments (2)
Hi @mcx808, thanks for reaching out. I think you meant Get-PAOrder
rather than Get-PACertificate
, right? In any case, the reason the timestamps on the order object are strings is partially ACME spec related and partially PowerShell related.
The module's order object is effectively the ACME order object with some module-specific stuff tacked onto it. All timestamps in ACME objects like the expires
field on an order use the format described in RFC3339 which is an "Internet profile" of ISO 8601. This is useful because the objects are generally sent as JSON and there's no official way to represent a datetime in JSON. So when I was adding the additional timestamp properties, I wanted to stay consistent with the other fields.
Because I'm reading/writing the order objects from/to disk as JSON, it was convenient to keep them in that same RFC3339 format particularly since the PowerShell 5.1 (and earlier) JSON library doesn't try to auto-convert them to DateTime objects like the JSON library that PowerShell (Core) now uses tries to helpfully do. For example, compare the results of this code between PowerShell 5.1 and any version past 6.0.
'{"mydate":"2023-11-17T06:38:30Z"}' | ConvertFrom-Json | gm
Essentially, it comes down to wanting consistent functionality between PowerShell versions without needing to muddy up the codebase with a bunch of engine-specific code paths. I could theoretically change it in the next major version. But it sort of doesn't make sense to until I can drop PowerShell 5.1 as a supported runtime.
Also, the reason why the timestamps on the output of Get-PACertificate
are actual DateTime objects is because that object is being generated directly from the certificate data and never gets written or read from disk as JSON.
from posh-acme.
Hi @rmbolger,
I think you meant Get-PAOrder rather than Get-PACertificate, right?
Yes, sorry my mis-type there.
Thank you for the detailed explanation. Perfectly reasonable to follow the RFC for the ACME order spec, I'll bear in mind to use [datetime](Get-PAOrrder).RenewAfter
for that check in my scripts. I'm glad I asked before submitting a PR to change anything.
Thanks!
from posh-acme.
Related Issues (20)
- Set-PAOrder revokes certificate when -Force used, even with -RevokeCert:$false HOT 1
- [WebRoot Plugin] Support for Network Share Credentials HOT 3
- How to use with PowerDNS, can't fins DNS-plugin? HOT 12
- Feedback Request: Dropping Support for PowerShell 5.1 HOT 5
- 1year / 365 days cert ZeroSSL (aka Lifetime LifetimeDays variable) HOT 8
- WEDOS DNS support ? HOT 5
- Multiple Accounts with DigiCert HOT 4
- Cloudflare Plug In fails to convert String to SecureString HOT 7
- Submit-Renewal doesn't appear to follow ErrorAction HOT 2
- Is there a full list of supported fields for -Subject? HOT 3
- 404 on Submit-ChallengeValidation when using LetsEncrypt Staging HOT 1
- OVH plugin using DnsAlias fails if not using subdomain of the OVHdomain HOT 2
- Trying to use ZeroSSL HOT 4
- Problem with OVH plugin for creating/renewing certificates HOT 8
- Error requesting certificate with WebRoot plugin HOT 5
- FullChainFile doesn't contain ISRG Root X1 HOT 9
- Active24 plugin no longer working HOT 25
- Pull cert into local certificate store using FQDN and Subsequent renew HOT 5
- CmdLets Repeatedly asking for DNS Text Records HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from posh-acme.