feat(api-server): Add HTTPS support and custom certificate configuration #3874

Open
mohanad-80 wants to merge 7 commits from mohanad-80/https-api-server into master
mohanad-80 commented 2025-09-11 15:59:09 +00:00 (Migrated from github.com)

Description:
This PR adds HTTPS support to the API server plugin, allowing users to enable HTTPS and provide custom certificate and private key files for secure API access.

Key changes:

  • Added useHttps, certPath, and keyPath fields to the API server config.
  • Updated the plugin menu to include a submenu for HTTPS settings, allowing users to:
    • Enable/disable HTTPS.
    • Select certificate and private key files via file dialogs.
  • Updated backend logic to start an HTTPS server when enabled, using the provided certificate and key.
  • Ensured the server restarts automatically when any relevant config changes (hostname, port, useHttps, certPath, keyPath).
  • Added i18n strings for the new menu items and dialogs.

Why:
This enables secure remote control and API access over HTTPS, addressing feature request #3647.

Testing:

  • Tested HTTP and HTTPS modes on Windows.
  • Verified that changing certificate/key paths and toggling HTTPS restarts the server as expected.
  • Confirmed that WebSocket routes work with HTTPS.

closes #3647

**Description:** This PR adds HTTPS support to the API server plugin, allowing users to enable HTTPS and provide custom certificate and private key files for secure API access. **Key changes:** - Added `useHttps`, `certPath`, and `keyPath` fields to the API server config. - Updated the plugin menu to include a submenu for HTTPS settings, allowing users to: - Enable/disable HTTPS. - Select certificate and private key files via file dialogs. - Updated backend logic to start an HTTPS server when enabled, using the provided certificate and key. - Ensured the server restarts automatically when any relevant config changes (hostname, port, useHttps, certPath, keyPath). - Added i18n strings for the new menu items and dialogs. **Why:** This enables secure remote control and API access over HTTPS, addressing feature request [#3647](https://github.com/th-ch/youtube-music/issues/3647). **Testing:** - Tested HTTP and HTTPS modes on Windows. - Verified that changing certificate/key paths and toggling HTTPS restarts the server as expected. - Confirmed that WebSocket routes work with HTTPS. --- closes #3647
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin mohanad-80/https-api-server:mohanad-80/https-api-server
git switch mohanad-80/https-api-server

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff mohanad-80/https-api-server
git switch mohanad-80/https-api-server
git rebase master
git switch master
git merge --ff-only mohanad-80/https-api-server
git switch mohanad-80/https-api-server
git rebase master
git switch master
git merge --no-ff mohanad-80/https-api-server
git switch master
git merge --squash mohanad-80/https-api-server
git switch master
git merge --ff-only mohanad-80/https-api-server
git switch master
git merge mohanad-80/https-api-server
git push origin master
Sign in to join this conversation.
No reviewers
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: YTMD/youtube-music#3874
No description provided.