Spring Boot SSL-приложение с регистрацией Eureka - PullRequest
0 голосов
/ 06 марта 2020

Я пытаюсь подключиться к серверу Eureka Registry с помощью своего микросервиса. Я добавил SSL, и теперь eureka не может его зарегистрировать. Я понятия не имею, что сейчас не так, потому что у меня есть другой микросервис, и все работает отлично. Я использую application.yml:

Eureka Server

spring:
  application:
    name: service-registry

server:
  port: 13103
  ssl:
    key-store: src/main/resources/keystore.p12
    key-store-password: changeit
    keyStoreType: PKCS12
    keyAlias: 1
    enabled: true

eureka:
  instance:
    hostname: localhost
    non-secure-port-enabled: false
    prefer-ip-address: false
    secure-port-enabled: true
    secure-port: ${server.port}
  client:
    register-with-eureka: false
    fetch-registry: false
    serviceUrl:
      defaultZone: https://${eureka.instance.hostname}:${server.port}/eureka/

logging:
  level:
    com:
      netflix:
        eureka: OFF
        discovery: OFF

Рабочий микросервис:

spring:
  application:
    name: servicedashboard

eureka:
  instance:
    appname: servicedashboard
  client:
    fetchRegistry: true
    serviceUrl:
      defaultZone: https://project.cskperm.ru:13103/eureka

server:
  ssl:
    key-store: src/main/resources/keystore.p12
    key-store-password: changeit
    key-store-type: pkcs12
    key-password: changeit
    keyAlias: 1
    enabled: true
  port: 13102

Микросервис с выдачей:

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/swiftproject?createDatabaseIfNotExist=true
    username: -----
    password: -----

  application:
    name: servicemain

  jackson:
    serialization:
      write-dates-as-timestamps: false
    deserialization:
      adjust_dates_to_context_time_zone : false
    mapper:
      DEFAULT_VIEW_INCLUSION: true

  jpa:
    show-sql: false
    generate-ddl: true
    hibernate:
      ddl-auto: update

    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
        format_sql: true
        jdbc:
          lob:
            non_contextual_creation: true

  ## MULTIPART (MultipartProperties)
  # Enable multipart uploads
  servlet:
    multipart:
      enabled: true
  # Threshold after which files are written to disk.
      file-size-threshold: 2KB
  # Max file size.
      max-file-size: 1024MB
  # Max Request Size
      max-request-size: 1024MB

  ## File Storage Properties
  # All files uploaded through the REST API will be stored in this directory

eureka:
  instance:
    appname: servicemain
  client:
    fetchRegistry: true
    serviceUrl:
      defaultZone: https://project.cskperm.ru:13103/eureka

server:
  ssl:
    key-store: src/main/resources/keystore.p12
    key-store-password: changeit
    key-store-type: pkcs12
    key-password: ----
    keyAlias: 1
    enabled: true
  port: 13101
  servlet:
    context-path: /project/api/
  error:
    whitelabel:
      enabled: false





file:
  storage-directory: C://Servers/SwiftProject/FileStore
  download-directory: C://Servers/SwiftProject/Downloads
  static-directory: C://Servers/SwiftProject/StaticFile
  web-service-directory: C://Servers/nginx/html
  web-service-sub-directory: /files
  db-archive-directory: C://Servers/SwiftProject/DBArchive
  #objects-scheme-directory: C://Servers/SwiftProject/Scheme

email:
  template-directory: C://Servers/SwiftProject/EmailTemplates

#security:
#  oauth2:
#    sso:
#      loginPath: /project/api/implicit/callback

okta:
  api:
    url: https://dev-967792.oktapreview.com
    apikey: 00aXem3pV9T_rPmzBvkkMvbMDdvwmUmlKi-_AAVuyI
    #SwiftProject Свеза
    groupId: 00gfv5c2jjeiLpyXJ0h7
  oauth2:
    issuer: https://dev-967792.oktapreview.com/oauth2/default
    clientId: 0oafp79ivqY7IXuyi0h7

nats:
  serverURL: nats://46.146.239.147:13002

compress:
  compressQuality: 0.5f
  maxWidth: 7168 # To disable this, just set the value to Infinity.
  maxHeight: 7168 # To disable this, just set the value to Infinity.
  minWidth: 0
  minHeight: 0
  convertSize: 5000000 # 5 Мб
  # Коэффициент, на который уменьшается размер изображения при сжатии изображения.
  coefForSize: 0.7
  # Картинки меньше указаного размера вообще не сжимаем
  globalMinWidth: 500
  globalMinHeight: 500


---
spring:
  profiles: dev-anna
  jpa:
    show-sql: true
file:
  web-service-directory: D://IntelliJ IDEA Projects/swiftproject.web

---
spring:
  profiles: test
server:
  ssl:
    key-store: src/main/resources/keystore.p12
    key-store-password: changeit
    key-store-type: pkcs12
    key-password: changeit
    keyAlias: 1
    enabled: true
  port: 13101
file:
  web-service-directory: C://Servers/nginx/html
nats:
  serverURL: nats://192.168.1.41:13002
eureka:
  instance:
    appname: servicemain
  client:
    fetchRegistry: true
    serviceUrl:
      defaultZone: https://project.cskperm.ru:13103/eureka

---
spring:
  profiles: prod
server:
  ssl:
    key-store: src/main/resources/keystore.p12
    key-store-password: changeit
    key-store-type: pkcs12
    key-password: ---
    keyAlias: 1
    enabled: true
  port: 13001
file:
  web-service-directory: C://Servers/nginx/html
nats:
  serverURL: nats://0.0.0.0:13002
eureka:
  instance:
    appname: servicemain
  client:
    fetchRegistry: true
    serviceUrl:
      defaultZone: https://project.cskperm.ru:13003/eureka

---
spring:
  profiles: db-test
  datasource:
    url: jdbc:postgresql://46.146.---.---:13433/---?createDatabaseIfNotExist=true
    username: ----
    password: ----

---
spring:
  profiles: dev-andrey
  jpa:
    show-sql: true
file:
  web-service-directory: D://db-test
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...