Fix parsing errors while using IPv6 URLs. #6327
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When using an IPv6 address instead of a domain name for the server url, enrollment fails with an error "_authorizations_seg not found".
See issue #6326
Rootcause
Issue with parsing the URL containing IPv6 addresses. during the enrollment process.
Sample Logs:
[Tue Apr 22 19:21:16 UTC 2025] code='201'
[Tue Apr 22 19:21:16 UTC 2025] original='{"id":"qfst0PFCO2RexOQhIqGVwgvAdDpMPm0K","status":"pending","expires":"2025-04-23T19:21:17Z","identifiers":[{"type":"dns","value":"maddi-asa"}],"notBefore":"2025-04-22T19:20:17Z","notAfter":"2025-04-23T19:21:17Z","authorizations":["https://[2001:420:2c7f:11:10:86:92:243]/acme/acme/authz/NKLZIFVVTltOWpKEvoAvT5nfjf52haDb"],"finalize":"https://[2001:420:2c7f:11:10:86:92:243]/acme/acme/order/qfst0PFCO2RexOQhIqGVwgvAdDpMPm0K/finalize"}'
[Tue Apr 22 19:21:16 UTC 2025] response='{"id":"qfst0PFCO2RexOQhIqGVwgvAdDpMPm0K","status":"pending","expires":"2025-04-23T19:21:17Z","identifiers":[{"type":"dns","value":"maddi-asa"}],"notBefore":"2025-04-22T19:20:17Z","notAfter":"2025-04-23T19:21:17Z","authorizations":["https://[2001:420:2c7f:11:10:86:92:243]/acme/acme/authz/NKLZIFVVTltOWpKEvoAvT5nfjf52haDb"],"finalize":"https://[2001:420:2c7f:11:10:86:92:243]/acme/acme/order/qfst0PFCO2RexOQhIqGVwgvAdDpMPm0K/finalize"}'
[Tue Apr 22 19:21:16 UTC 2025] Le_LinkOrder='https://[2001:420:2c7f:11:10:86:92:243]/acme/acme/order/qfst0PFCO2RexOQhIqGVwgvAdDpMPm0K'
[Tue Apr 22 19:21:17 UTC 2025] Le_OrderFinalize='https://[2001:420:2c7f:11:10:86:92:243]/acme/acme/order/qfst0PFCO2RexOQhIqGVwgvAdDpMPm0K/finalize'
[Tue Apr 22 19:21:17 UTC 2025] _authorizations_seg
[Tue Apr 22 19:21:17 UTC 2025] _authorizations_seg not found.
[Tue Apr 22 19:21:17 UTC 2025] pid
[Tue Apr 22 19:21:17 UTC 2025] No need to restore nginx config, skipping.
[Tue Apr 22 19:21:17 UTC 2025] _clearupdns
[Tue Apr 22 19:21:17 UTC 2025] dns_entries
[Tue Apr 22 19:21:17 UTC 2025] Skipping dns.
[Tue Apr 22 19:21:17 UTC 2025] _on_issue_err
[Tue Apr 22 19:21:17 UTC 2025] Please add '--debug' or '--log' to see more information.
[Tue Apr 22 19:21:17 UTC 2025] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[Tue Apr 22 19:21:17 UTC 2025] _chk_vlist
[Tue Apr 22 19:21:17 UTC 2025] socat doesn't exist.
[Tue Apr 22 19:21:17 UTC 2025] Diagnosis versions:
Solution
Fix the logic to parse authorization url properly.
Tests Executed
Certificate enrollment with a Step-ca server using IPv4, IPv6, domain name in the server url.