Eureka secure port always 443 when configuring server.port: 0 and ssl certificate

334 views
Skip to first unread message

sauro...@gmail.com

unread,
Jun 17, 2016, 7:05:54 AM6/17/16
to eureka_netflix
Hi,

I´m trying to configure my spring boot services over https using a jks, and registering in eureka.

My configuration is like:

server:
port: 0
ssl:
enabled: true
key-store: testjks2.jks
key-password: test
key-store-password: test
key-alias: localhost
trust-store: testjks2.jks
trust-store-password: test
key-store-type: jks
use-forward-headers: true
.
.
.
instance:
secure-port-enabled: true
non-secure-port-enabled: false
health-check-url: https://127.0.0.1:${server.port}/health
status-page-url: https://127.0.0.1:${server.port}/info

metadata-map:
instanceId: ${random.value}
spring-application-name: ${spring.application.instance_id:${random.value}}
app-group-name: testing
appname: ms-test
# secure-port: 6868 If uncommented, it register on eureka in the securePort tag correctly. If I configure local.server.port property, cast exception trying to convert int to String
secure-health-check-url: https://127.0.0.1:${server.port}/health
secure-virtual-host-name: ${spring.application.name}

My microservice deploys ok, but it register in eureka the following information:

<port enabled="false">64149</port>
<securePort enabled="true">443</securePort>

The problem is when i tried to access through Zuul, it always tries to access through 443 port, not with the 64149 port (In microservice, it deploys https over 64149, and everything is ok with it).

Is there any way to tell eureka that my random port is the correct secure port? I´m using Brixton.RELEASE versions of the Netflix OSS.

Thanks in advance for your help!

Best regards
Reply all
Reply to author
Forward
0 new messages