[GH-ISSUE #4936] [Bug]: no https in subs QR #3456

Closed
opened 2026-10-31 20:32:33 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @reza74ta-spec on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4936

Describe the bug

provided subscription url from QR code does not contain https and causing problem

How to reproduce the problem

.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.7

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 24

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @reza74ta-spec on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4936 ### Describe the bug provided subscription url from QR code does not contain https and causing problem ### How to reproduce the problem . ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.7 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 24 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:32:33 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 5, 2026):

Thanks for the report. I traced the relevant code to explain what is happening and how to fix it.

Root cause

The subscription URL scheme (http vs https) is determined by BuildSubURIBase in web/service/setting.go. It checks only whether TLS certificate and key files are configured for the subscription server specifically (subCertFile + subKeyFile). The panel's own main TLS certificate (configured under Settings → Panel → Certs) is a separate setting and does not affect the subscription URL scheme. When subCertFile/subKeyFile are empty (the default after a fresh install), the subscription URL is always http://.

Two ways to get https:// in subscription QR codes

  1. Go to Panel Settings → Subscription → Certs tab.
  2. Fill in "Subscription Cert Path" and "Subscription Key Path" with the paths to your TLS certificate and private key files (e.g. those issued by Let's Encrypt: /etc/letsencrypt/live/yourdomain.com/fullchain.pem and privkey.pem).
  3. Save and restart the service (x-ui restart or systemctl restart x-ui).

Once both paths are set, BuildSubURIBase will emit https:// automatically.

Option B — Override the subscription URI manually

  1. Go to Panel Settings → Subscription (first tab).
  2. In the "Subscription URI" field, enter the full base URL including scheme, e.g.:
    https://your-domain.com:2096/your-sub-path/
    
  3. Repeat for "Subscription JSON URI" and "Subscription Clash URI" if those are enabled.
  4. Save.

This bypasses the auto-detection entirely — the value you enter is used verbatim.

Clarification needed

To give more targeted advice, could you share:

  1. Does your panel itself serve HTTPS (i.e. did you configure a TLS cert under Settings → Panel → Certs)? If so, are the panel and the subscription server using the same port or different ports?
  2. What port is the subscription server running on? (Panel Settings → Subscription → "Subscription Port")
  3. Do you have a domain name pointed at this server, or are you using a bare IP?

This will help confirm which option above best applies to your setup.

<!-- gh-comment-id:4627235428 --> @github-actions[bot] commented on GitHub (Jun 5, 2026): Thanks for the report. I traced the relevant code to explain what is happening and how to fix it. ## Root cause The subscription URL scheme (`http` vs `https`) is determined by `BuildSubURIBase` in `web/service/setting.go`. It checks **only** whether TLS certificate and key files are configured for the **subscription server** specifically (`subCertFile` + `subKeyFile`). The panel's own main TLS certificate (configured under Settings → Panel → Certs) is a separate setting and does **not** affect the subscription URL scheme. When `subCertFile`/`subKeyFile` are empty (the default after a fresh install), the subscription URL is always `http://`. ## Two ways to get `https://` in subscription QR codes ### Option A — Configure TLS for the subscription server (recommended if sub server has its own port/cert) 1. Go to **Panel Settings → Subscription → Certs** tab. 2. Fill in **"Subscription Cert Path"** and **"Subscription Key Path"** with the paths to your TLS certificate and private key files (e.g. those issued by Let's Encrypt: `/etc/letsencrypt/live/yourdomain.com/fullchain.pem` and `privkey.pem`). 3. Save and restart the service (`x-ui restart` or `systemctl restart x-ui`). Once both paths are set, `BuildSubURIBase` will emit `https://` automatically. ### Option B — Override the subscription URI manually 1. Go to **Panel Settings → Subscription** (first tab). 2. In the **"Subscription URI"** field, enter the full base URL including scheme, e.g.: ``` https://your-domain.com:2096/your-sub-path/ ``` 3. Repeat for "Subscription JSON URI" and "Subscription Clash URI" if those are enabled. 4. Save. This bypasses the auto-detection entirely — the value you enter is used verbatim. ## Clarification needed To give more targeted advice, could you share: 1. Does your panel itself serve HTTPS (i.e. did you configure a TLS cert under **Settings → Panel → Certs**)? If so, are the panel and the subscription server using the **same port** or different ports? 2. What port is the subscription server running on? (Panel Settings → Subscription → "Subscription Port") 3. Do you have a domain name pointed at this server, or are you using a bare IP? This will help confirm which option above best applies to your setup.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3456
No description provided.