public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-acme] Fix bug 4687: Bad IP identifier in ACME certificate requests.
@ 2026-11-17 18:56 Bugzy
  0 siblings, 0 replies; only message in thread
From: Bugzy @ 2026-11-17 18:56 UTC (permalink / raw)
  To: pve-devel

From e709aabd52358ba460cb1829c27d8a37e643c537 Mon Sep 17 00:00:00 2001
From: Bugzy <pvebugs@fluidolabs.com>
Date: Tue, 17 Nov 2026 14:54:10 -0300
Subject: [PATCH] Fix bug 4687: Bad IP identifier in ACME certificate
requests.

Allow using IP addresses in ACME certificate requests.

Note: Re-rolled from a Bugzilla patch by Tim, issue opened by Bugzy.

Bugzilla comment:
https://bugzilla.proxmox.com/show_bug.cgi?id=4687#c5

Original patch:
https://bugzilla.proxmox.com/attachment.cgi?id=1179

---
Dear Proxmox maintainers,

This patch is part of another patch I will submit for the project
`pve-common`.

We need to fix both `./src/PVE/ACME.pm` in this project, as well as
the file `./src/PVE/Certificate.pm` in the project `pve-common`.

Then, it will fix the `badCSR` error we currently get if we request
certificates for a raw IP address.

Signed-off-by: Bugzy <pvebugs@fluidolabs.com>
---
 src/PVE/ACME.pm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/PVE/ACME.pm b/src/PVE/ACME.pm
index d3604b4a9a..b3d4a90049 100644
--- a/src/PVE/ACME.pm
+++ b/src/PVE/ACME.pm
@@ -14,6 +14,7 @@ use Digest::SHA qw(sha256 sha256_hex hmac_sha256);

 use HTTP::Request;
 use LWP::UserAgent;
+use Net::IP;

 use Crypt::OpenSSL::Random;
 use Crypt::OpenSSL::RSA;
@@ -408,6 +409,13 @@ sub get_account {
     return $self->update_account();
 }

+# Returns whether a domain is a "dns" name or an "ip" address
+# for use in certificates / CSRs.
+sub get_domain_type {
+    my ($domain) = @_;
+    return (new Net::IP($domain)) ? 'ip' : 'dns';
+}
+
 # Start a new order for one or more domains
 # POST to newOrder endpoint
 # Expects a '201 Created' reply
@@ -417,7 +425,8 @@ sub new_order {

     my $url = $self->_method('newOrder');
     my $req = {
-        identifiers => [map { { type => 'dns', value => $_ } } @$domains],
+        identifiers => [map { { type => get_domain_type($_), value => $_ }
} @$domains],
+
     };

     my $r = $self->do(POST => $url, $req);
-- 
2.47.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-17 19:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 18:56 [PATCH proxmox-acme] Fix bug 4687: Bad IP identifier in ACME certificate requests Bugzy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal