Skip to content

[ISSUE #14036] Support TLS prefix for HTTP login - #15405

Merged
KomachiSion merged 2 commits into
alibaba:developfrom
hutiefang76:codex/fix-nacos-http-login-tls-prefix
Jun 30, 2026
Merged

KomachiSion merged 2 commits into
alibaba:developfrom
hutiefang76:codex/fix-nacos-http-login-tls-prefix

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Fixes #14036.

When HttpLoginProcessor receives a server address without an explicit http:// or https:// prefix, it currently always prepends http://. That makes the login request ignore the Nacos client TLS switch and prevents HTTPS login for callers that pass plain addresses.

This change keeps explicitly prefixed addresses unchanged, and only uses the Nacos client TLS property when the prefix is missing. If tls.enable=true, the login URL is built with https://; otherwise it keeps the existing default http:// behavior.

Brief changelog

  • Use TlsSystemConfig.TLS_ENABLE when HttpLoginProcessor needs to infer a missing protocol prefix.
  • Add a regression test covering tls.enable=true with a plain server address.

Verifying this change

  • JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -s .codex-empty-settings.xml -pl client-basic -am -Dtest=HttpLoginProcessorTest -Dsurefire.failIfNoSpecifiedTests=false test
    • Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
  • JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -s .codex-empty-settings.xml -pl client-basic -am -DskipITs -DskipRat test
    • Reactor modules all SUCCESS; nacos-client-basic reported Tests run: 281, Failures: 0, Errors: 0, Skipped: 0.
  • git diff --check

Checklist:

  • Make sure there is a Github issue filed for the change.
  • Format the pull request title like [ISSUE #123] ....
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction.
  • Run full mvn -B clean package apache-rat:check spotbugs:check -DskipTests / full integration-test suite.

@github-actions

Copy link
Copy Markdown

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API、新增配置参数、修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

KomachiSion
KomachiSion previously approved these changes Jun 25, 2026
@KomachiSion

Copy link
Copy Markdown
Collaborator

I re-checked the linked issue and the patch. The problem is valid and the fix direction looks correct to me.

The current blocker is CI formatting only: spotless:check is failing on the changed files. Please run mvn spotless:apply and push the formatting update so CI can continue. If this is not fixed soon, we may need to let someone else take over the CI cleanup.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@KomachiSion
KomachiSion merged commit a8d22aa into alibaba:develop Jun 30, 2026
6 checks passed
@KomachiSion KomachiSion added this to the 3.2.3 milestone Jun 30, 2026
@KomachiSion KomachiSion added area/Client Related to Nacos Client SDK area/plugin labels Jun 30, 2026
KomachiSion pushed a commit that referenced this pull request Jul 7, 2026
* Fix HTTP login TLS prefix

* style: apply spotless formatting

(cherry picked from commit a8d22aa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/Client Related to Nacos Client SDK area/plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HttpLoginProcessor.java 不支持https协议

3 participants