public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Bugzy <pvebugs@fluidolabs.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-acme] Fix bug 4687: Bad IP identifier in ACME certificate requests.
Date: Tue, 17 Nov 2026 15:56:52 -0300	[thread overview]
Message-ID: <CAHbfunU5==HYBNv_1smJicrHrrWMvVZyWzVWACa_482_5DfVww@mail.gmail.com> (raw)

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

                 reply	other threads:[~2026-11-17 19:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHbfunU5==HYBNv_1smJicrHrrWMvVZyWzVWACa_482_5DfVww@mail.gmail.com' \
    --to=pvebugs@fluidolabs.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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