Registering a secure application

If your application is exposed over a secure SSL port, you should change two flags from the EurekaInstanceConfignonSecurePortEnabled to false and securePortEnabled to true. This forces Eureka to publish instance information that shows an explicit preference for secure communication. The Spring Cloud DiscoveryClient will always return a URL starting with HTTPS for a service that is configured this way, and the Eureka instance information will have a secure health check URL:

eureka: instance:  nonSecurePortEnabled: false  securePortEnabled: true  securePort: ${PORT:8091}  statusPageUrl: https://localhost:${eureka.instance.securePort}/info  healthCheckUrl: https://localhost:${eureka.instance.securePort}/health homePageUrl: ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.