m-barthelemy / acmeswift Goto Github PK
View Code? Open in Web Editor NEWA Let's encrypt (Acmev2) Swift client library
License: MIT License
A Let's encrypt (Acmev2) Swift client library
License: MIT License
tl;dr: Should we add the token
to the ChallengeDescription
type?
First: Thank you for this package!
When I stumbled over the need to self-manage public certificates I couldn't believe my luck: There is a swift package for ACME!
A tiny little thing I think could be improved:
Currently, you can either call acme.orders.getAuthorizations(from: order)
to get the "raw data", or use the acme.orders.describePendingChallenges(from: order, preferring: .http)
API to get the little value encoding dance for free.
Getting the correct value for the challenges is clearly nicer, but on ChallengeDescription
you can not access the token
directly.
Based on how you'd implement "placing" the http value on you server, you'll now have to extract it out of the endpoint
URL again.
Additionally, we could also move the get me the value for this challenge code to some reusable place to decouple it from the describePendingChallenges
API.
After calling finalize, the order information passed back does not contain a url
.
Eg:
let (privateKey, _, finalized) = try await acme.orders.finalizeWithRsa(order: order, domains: [domain])
let refreshed = try await acme.orders.get(url: finalized.url!) //url is not set
Also, acme.orders.get(url:)
and acme.orders.refresh(&order)
do not seem to include the url
in their response.
That means that one cannot write a loop like this ATM:
let (privateKey, _, finalized) = try await acme.orders.finalizeWithRsa(order: order, domains: [domain])
var orderForDownload = finalized
while orderForDownload.status == .processing {
try await Task.sleep(for: .seconds(1))
try await acme.orders.refresh(&orderForDownload) //this will fail
// as a work-around the url of the original order data must be used
// orderForDownload = try await acme.orders.get(url: order.url!)
}
Seeing as there are currently no active PRs, now might be a great time to switch to using main
as the default branch name for the repo.
https://github.com/apple/swift-certificates can create CSRs.
This means that the basic CSR feature in this lib can be removed, or made to use swift-certificates under the hood
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.