我需要用我的微服务以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