Skip to content

HttpLoginProcessor.java 不支持https协议 #14036

Closed

Description

@joydaliu
@Override
public LoginIdentityContext getResponse(Properties properties) {
    
    String contextPath = ContextPathUtil.normalizeContextPath(
            properties.getProperty(PropertyKeyConst.CONTEXT_PATH, DEFAULT_NACOS_WEB_CONTEXT));
    String server = properties.getProperty(NacosAuthLoginConstant.SERVER, StringUtils.EMPTY);
    
    if (!server.startsWith(HTTPS_PREFIX) && !server.startsWith(HTTP_PREFIX)) {
        if (!InternetAddressUtil.containsPort(server)) {
            server = server + InternetAddressUtil.IP_PORT_SPLITER + ClientBasicParamUtil.getDefaultServerPort();
        }
        **server = HTTP_PREFIX + server;**
    }

server = HTTP_PREFIX + server; 这一行server 的协议头 能否通过配置动态拼接,当前是写死的http

Activity

  1. Melod-YI commented on Dec 17, 2025

    @Melod-YI
    Contributor

    这个判断条件里不是有一条HTTPS_PREFIX的检查么,改下server的配置为https开头就好了吧

  2. joydaliu commented on Dec 18, 2025

    @joydaliu
    Author

    这个判断条件里不是有一条HTTPS_PREFIX的检查么,改下server的配置为https开头就好了吧

    server = HTTP_PREFIX + server; 这个地方是写死的,server的配置是nacos://xxxx

  3. Melod-YI commented on Dec 18, 2025

    @Melod-YI
    Contributor

    这个判断条件里不是有一条HTTPS_PREFIX的检查么,改下server的配置为https开头就好了吧

    server = HTTP_PREFIX + server; 这个地方是写死的,server的配置是nacos://xxxx

    你这个配法是dubbo吗?
    感觉上这是个dubbo的问题,似乎他的配置层面就不支持这种格式,可以先询问下dubbo社区对于注册中心开启tls的配置方式是什么。

  4. KomachiSion commented on Dec 18, 2025

    @KomachiSion
    Collaborator

    可以优化一下, 如果入参中的地址没有带有http或者https的信息, 可以从其他的参数,比如defaultSchema之类的参数中获取一下,若再没有, 再默认使用http

    这样dubbo就不需要修改了。 其他框架可能也能支持。

  5. KomachiSion commented on Dec 18, 2025

    @KomachiSion
    Collaborator

    issue中可以讨论一下这个参数命名,看下怎么更好的表达这个意思。

  6. joydaliu commented on Dec 18, 2025

    @joydaliu
    Author

    issue中可以讨论一下这个参数命名,看下怎么更好的表达这个意思。

    Image 可以公用这个server.ssl.enabled配置吗
  7. Melod-YI commented on Dec 18, 2025

    @Melod-YI
    Contributor

    issue中可以讨论一下这个参数命名,看下怎么更好的表达这个意思。

    HTTP client那边有一个tls.enable的参数

    Image

    在dubbo社区的issue里,看到一个疑似配置命名冲突的问题。
    apache/dubbo#14311

    Image
  8. KomachiSion commented on Dec 23, 2025

    @KomachiSion
    Collaborator

    issue中可以讨论一下这个参数命名,看下怎么更好的表达这个意思。

    HTTP client那边有一个tls.enable的参数

    Image 在dubbo社区的issue里,看到一个疑似配置命名冲突的问题。 [apache/dubbo#14311](https://github.com/apache/dubbo/issues/14311) Image

    这个参数是否是grpc客户端使用的参数?

  9. KomachiSion commented on Dec 23, 2025

    @KomachiSion
    Collaborator

    server.ssl.enabled

    我没有找到这个参数的位置, 您看的是哪个客户端版本

  10. joydaliu commented on Dec 23, 2025

    @joydaliu
    Author

    server.ssl.enabled

    这个是springboot内置的配置 org.springframework.boot.web.server.autoconfigure.ServerProperties

  11. KomachiSion commented on Jan 7, 2026

    @KomachiSion
    Collaborator

    那肯定不行啊, nacos-client怎么能依赖spring的配置呢,会循环依赖

  12. added a commit that references this issue on Jun 30, 2026
  13. added this to the 3.2.3 milestone on Jun 30, 2026
  14. added a commit that references this issue on Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ClientRelated to Nacos Client SDKkind/enhancementCategory issues or prs related to enhancement.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions