Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance not being marked as secure when secure=true tag present #743

Open
welsh opened this issue Aug 12, 2021 · 2 comments
Open

Instance not being marked as secure when secure=true tag present #743

welsh opened this issue Aug 12, 2021 · 2 comments

Comments

@welsh
Copy link

welsh commented Aug 12, 2021

Specifically using:

  • Spring Boot: 2.4.6
  • Spring Cloud: 2020.0.3
  • Spring Cloud Consul Discover 3.0.3

When the ConsulDiscoveryClient.getInstances() is called, and the service is registered within consul with the secure=true tag being set, the returned ServiceInstance is not flagged as secure.

From looking at the ConsulServiceInstance, it appears that getSecure(healthService) is only checking the Metadata, however I believe it should be checking both the metadata and the tags.

The reason I believe it should be both is because our Spring Cloud Gateway instances (Spring Boot 2.3.9, Spring Cloud Hoxton.SR9) is registering itself with consul, and Spring Cloud Consul Discovery is registering and setting that secure=true tag and not setting any metadata.

Edit: I realize after looking a bit more, this may be by design and PR #700 could resolve it once completed.

@ryanjbaxter
Copy link
Contributor

I would say yes #700 would probably address this.

@spencergibb thoughts?

@welsh
Copy link
Author

welsh commented Aug 16, 2021

Short term I've also solved it by updating the app in question temporarily to have:

spring:
  cloud:
    consul:
      discovery:
        metadata:
          secure: true

Until we can update it to a newer version of Spring Boot + Spring Cloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants