我需要用我的微服務以https尤里卡上註冊,所以我改變這樣我尤里卡配置:服務不想使用SSL
info:
component: Eureka
server:
port: 8761
ssl:
enabled: true
ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA
key-store: target/classes/keystore/keystore.jks
key-store-password: .....
key-alias: .....
key-password: .....
protocol: TLS
eureka:
instance:
hostname: localhost
securePort: ${server.port}
nonSecurePortEnabled: false
securePortEnabled: true
secureVirtualHostName: ${spring.application.name}
homePageUrl: https://${eureka.instance.hostname}:${server.port}/
statusPageUrl: https://${eureka.instance.hostname}:${server.port}/admin/info
metadataMap:
hostname : ${eureka.instance.hostname}
securePort: ${server.port}
client:
registerWithEureka: false
fetchRegistry: false
healthcheck:
enable: true
serviceUrl:
defaultZone: https://${eureka.instance.hostname}:${server.port}/eureka/
server:
waitTimeInMsWhenSyncEmpty: 0
enableSelfPreservation: true
它開始沒有問題,我可以去上網站。
我的微服務(configServer)在https上運行,但不在Eureka上註冊。我沒有錯誤消息。配置文件:
info:
component: Config Server
server:
port: 8889
ssl:
enabled: true
ciphers: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA
key-store: target/classes/keystore/keystore.jks
key-store-password: .....
key-alias: .....
key-password: ....
protocol: TLS
spring:
cloud:
config:
server:
git:
uri: .......
eureka:
client:
registerWithEureka: true
fetchRegistry: true
registryFetchIntervalSeconds: 5
securePortEnabled: true
serviceUrl:
defaultZone: https://127.0.0.1:8761/eureka/
healthcheck:
enabled: true
instance:
statusPageUrlPath: https://${management.context_path}/info
healthCheckUrlPath: https://${management.context_path}/health
leaseRenewalIntervalInSeconds: 10
securePort: ${server.port}
securePortEnabled: true
nonSecurePortEnabled: false
日誌我在調試模式下獲得:
2016-11-29 10:47:35.324 DEBUG 12032 --- [freshExecutor-0] .a.h.i.c.DefaultClientConnectionOperator : Connecting to localhost:8761
2016-11-29 10:47:35.328 DEBUG 12032 --- [freshExecutor-0] o.a.h.impl.conn.DefaultClientConnection : Connection [email protected] closed
2016-11-29 10:47:35.328 DEBUG 12032 --- [freshExecutor-0] o.a.h.impl.conn.DefaultClientConnection : Connection [email protected] shut down
2016-11-29 10:47:35.328 DEBUG 12032 --- [freshExecutor-0] o.a.h.impl.conn.DefaultClientConnection : Connection [email protected] closed
沒有HTTPS,我沒有問題。你知道什麼是錯的嗎?
沒有錯誤消息?你打開客戶端上的調試日誌記錄嗎? – spencergibb
是的。我在主帖中登錄了 – BokC