jmccl / acme-lw Goto Github PK
View Code? Open in Web Editor NEWAnother Let's Encrypt client library
License: MIT License
Another Let's Encrypt client library
License: MIT License
Hi,
Support for ACMEv1 is coming to an end per https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1.
We are also in the process of de-listing any clients that do not implement ACMEv2 support per letsencrypt/website#761.
Hi, can't build on freebsd.
find_packaged(CURL REQUIRED)
but the resulting target CURL::libcurl is not used.#include <ctime>
missing in acme-lw.h
<filesystem>
to avoid deprecation warning on <experimental/filesystem>
when found.Tried to open a PR, didn't get permission with token so here is a little patch
freebsd_patch.tar.gz
Hello,
maybe I am doing something wrong, but it does not compile on my CentOS7 OS
Create makefiles worked by typing "cmake3 ." (just "cmake" is an old 2.x version on CentOS7)
But then I get so many compile errors, don't know where I should begin...
First, "sting-Literals" did not work, so I cheanges "..."s just to "..." and this error did not came up again.
But after that there are still many errors (I post the errors at the end).
Originaly there is an old GCC compiler availave on CentOS7: 4.8.5
But I installd scl7 (devtoolset-7) and tried id again with GCC 7.3.1 - still the same...
And again with devtoolset-8 -> GCC 8.3.1 - still the same...
This is the build output:
Scanning dependencies of target acme_lw
[ 16%] Building CXX object lib/CMakeFiles/acme_lw.dir/__/internal/http.cpp.o
[ 33%] Building CXX object lib/CMakeFiles/acme_lw.dir/acme-exception.cpp.o
[ 50%] Building CXX object lib/CMakeFiles/acme_lw.dir/acme-lw.cpp.o
In file included from /home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:14:0:
/home/hansdampf/workspace_acme/acme-lw/lib/../internal/json.hpp: In Elementfunktion »nlohmann::json_pointer& nlohmann::json_pointer::operator/=(std::size_t)«:
/home/hansdampf/workspace_acme/acme-lw/lib/../internal/json.hpp:10217:5: Fehler: Deklaration von »array_index« überdeckt ein Element von 'this' [-Werror=shadow]
{
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Konstruktor »{anonymous}::Ptr<TYPE, FREE>::Ptr(TYPE*)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:57:83: Fehler: ungültige Operanden der Typen »const char [18]« und »const char*« für binäres »operator+«
throw acme_lw::AcmeException("Failed to create " + typeid(this).name());
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Elementfunktion »{anonymous}::Ptr<TYPE, FREE>& {anonymous}::Ptr<TYPE, FREE>::operator=({anonymous}::Ptr<TYPE, FREE>&&)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:73:83: Fehler: ungültige Operanden der Typen »const char [18]« und »const char« für binäres »operator+«
throw acme_lw::AcmeException("Failed to create " + typeid(this).name());
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: Im globalen Gültigkeitsbereich:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:104:25: Fehler: »EVP_MD_CTX_free« wurde in diesem Gültigkeitsbereich nicht definiert
typedef Ptr<EVP_MD_CTX, EVP_MD_CTX_free> EVP_MD_CTXptr;
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:104:40: Fehler: Templateargument 2 ist ungültig
typedef Ptr<EVP_MD_CTX, EVP_MD_CTX_free> EVP_MD_CTXptr;
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:104:78: Fehler: invalid type in declaration before »;« token
typedef Ptr<EVP_MD_CTX, EVP_MD_CTX_free> EVP_MD_CTXptr;
^
In file included from /usr/include/openssl/objects.h:965:0,
from /usr/include/openssl/evp.h:94,
from /home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:16:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Funktion »std::pair<std::basic_string, std::basic_string > {anonymous}::makeCertificateSigningRequest(const std::list<std::basic_string >&)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:269:122: Fehler: ungültige Umwandlung von »const char« in »char*« [-fpermissive]
if (!sk_X509_EXTENSION_push(extensions, X509V3_EXT_conf_nid(nullptr, nullptr, NID_subject_alt_name, value.c_str())))
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Funktion »T {anonymous}::extractExpiryData(const acme_lw::Certificate&, const std::function<T(const asn1_string_st)>&)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:349:45: Fehler: es gibt keine Argumente für »X509_getm_notAfter«, die von einem Templateparameter abhängen, weshalb eine Deklaration von »X509_getm_notAfter« verfügbar sein muss [-fpermissive]
ASN1_TIME * t = X509_getm_notAfter(x509);
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:349:45: Anmerkung: (mit »-fpermissive« wird G++ den Code akzeptieren, aber die Verwendung eines nicht deklarierten Namens ist veraltet)
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Konstruktor »acme_lw::AcmeClientImpl::AcmeClientImpl(const string&)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:383:37: Fehler: »RSA_get0_key« wurde in diesem Gültigkeitsbereich nicht definiert
RSA_get0_key(rsa, &n, &e, &d);
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Elementfunktion »std::string acme_lw::AcmeClientImpl::sign(const string&)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:416:49: Fehler: ungültige Umwandlung von »EVP_MD_CTX {aka env_md_ctx_st*}« in »{anonymous}::EVP_MD_CTXptr {aka int}« [-fpermissive]
EVP_MD_CTXptr context(EVP_MD_CTX_create());
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:419:32: Fehler: ungültiger Argumenttyp in unärem »« (haben »{anonymous}::EVP_MD_CTXptr {aka int}«)
EVP_DigestInit_ex(context, sha256, nullptr) != 1 ||
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:420:33: Fehler: ungültiger Argumenttyp in unärem »« (haben »{anonymous}::EVP_MD_CTXptr {aka int}«)
EVP_DigestSignInit(context, nullptr, sha256, nullptr, privateKey_) != 1 ||
^
In file included from /home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:16:0:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:421:35: Fehler: ungültiger Argumenttyp in unärem »« (haben »{anonymous}::EVP_MD_CTXptr {aka int}«)
EVP_DigestSignUpdate(context, s.c_str(), s.size()) != 1 ||
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:422:34: Fehler: ungültiger Argumenttyp in unärem »« (haben »{anonymous}::EVP_MD_CTXptr {aka int}«)
EVP_DigestSignFinal(context, nullptr, &signatureLength) != 1)
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:428:34: Fehler: ungültiger Argumenttyp in unärem »« (haben »{anonymous}::EVP_MD_CTXptr {aka int}«)
if (EVP_DigestSignFinal(context, &signature.front(), &signatureLength) != 1)
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Elementfunktion »T acme_lw::AcmeClientImpl::sendRequest(const string&, const string&, std::pair<std::basic_string, std::basic_string >)«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:450:25: Fehler: ungültige Operanden der Typen »const char [2]« und »const char [15]« für binäres »operator+«
u8R"("protected": ")" + protectd + ""," +
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In statischer Elementfunktion »static void acme_lw::AcmeClient::init()«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:631:70: Fehler: ungültige Operanden der Typen »const char [37]« und »const char« für binäres »operator+«
throw AcmeException("Unable to initialize endpoints from " + directoryUrl + ": " + e.what());
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Instanziierung von »T {anonymous}::extractExpiryData(const acme_lw::Certificate&, const std::function<T(const asn1_string_st)>&) [with T = long int]«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:670:10: von hier erfordert
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:349:45: Fehler: »X509_getm_notAfter« wurde in diesem Gültigkeitsbereich nicht definiert
ASN1_TIME * t = X509_getm_notAfter(x509);
^
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp: In Instanziierung von »T {anonymous}::extractExpiryData(const acme_lw::Certificate&, const std::function<T(const asn1_string_st)>&) [with T = std::basic_string]«:
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:684:10: von hier erfordert
/home/hansdampf/workspace_acme/acme-lw/lib/acme-lw.cpp:349:45: Fehler: »X509_getm_notAfter« wurde in diesem Gültigkeitsbereich nicht definiert
cc1plus: Alle Warnungen werden als Fehler behandelt
make[2]: *** [lib/CMakeFiles/acme_lw.dir/build.make:109: lib/CMakeFiles/acme_lw.dir/acme-lw.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:135: lib/CMakeFiles/acme_lw.dir/all] Fehler 2
make: *** [Makefile:150: all] Fehler 2
I just compiled acme_lw_client but it doesn't seem to work anymore.
Hi,
I am using a slightly modified build set up (Zig + Bazel), but have it working fine under std=c++17.
Getting errors like:
external/acme-lw/lib/acme-lw.cpp:432:46: error: invalid operands to binary expression ('basic_string<char8_t>' and 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>'))
"e":")"s + urlSafeBase64Encode(e) + u8R"(",
^ ~~~~~~~~~~~~~~~~~~~~~~
external/zig_sdk/lib/libcxx/include/string:4351:1: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char8_t' vs. 'char')
operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
^
external/zig_sdk/lib/libcxx/include/string:4388:1: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('basic_string<char8_t>' vs. 'char')
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs)
^
external/zig_sdk/lib/libcxx/include/string:4423:1: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char8_t' vs. 'std::str
ing' (aka 'basic_string<char, char_traits<char>, allocator<char>>'))
operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs)
I believe this is because of changes of char8_t vs char in c++20.
This is from acme-lw.cpp
It seems backwards to me....
const char * productionDirectoryUrl = "https://acme-staging-v02.api.letsencrypt.org/directory";
const char * stagingDirectoryUrl = "https://acme-v02.api.letsencrypt.org/directory";
Hi,
When I try to run against the staging environment it responds with 405:
`Running against staging environment.
Failed with error: Response code of 405 contacting https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/1249714784 with response of:
{
"type": "urn:ietf:params:acme:error:malformed",
"detail": "Method not allowed",
"status": 405
}`
Looks like it is due to:
letsencrypt/boulder#4577
Compiling with openssl 3 results in warnings due to use of deprecated functions.
The project does not compile because member nlohmann::json::parse does not exist
very sorry for interrupting you.
I am a novice
Failed in AcmeClient constructor with the following error text: "Response code of 400 contacting https://acme-staging-v02.api.letsencrypt.org/acme/new-acct with response of:\n{\n "type": "urn:ietf:params:acme:error:accountDoesNotExist",\n "detail": "No account exist... "
I used "openssl genrsa 4096 > account.key" to create the key then pass the full path to account.key as the first argument, followed by the domain name. The project is compiled in VS2019
Is there a step i'm missing? I thought acme-lw would create the new letsencrypt account. Any help or guidance would be greatly appreciated.
Thanks.
Hi,
I find it is a bit easier to control options dynamically, and so my plan (at least in my local version) is to support an option (probably an enum option of LETS_ENCRYPT_STAGING
or LETS_ENCRYPT_PROD
) as a constructor parameter to AcmeClient
.
This requires that AcmeClient::init
be a member function since it will need to know which option is selected, or else move part of init
into issueCertificate
as a lazy call.
So my questions are:
Thanks!
Kyle
Looking through the code, only http-01 challenges are supported. It would be great if it could also handle tls-alpn-01, and perhaps even dns-01.
Tls-alpn-01 could probably be handled with almost the same code (just direct to https instead of http). Not sure about dns-01.
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.