Spring boot 我无法加载带弹簧靴2.2.8和底拖的keystore.p12或.jks

Spring boot 我无法加载带弹簧靴2.2.8和底拖的keystore.p12或.jks,spring-boot,ssl,kotlin,keystore,undertow,Spring Boot,Ssl,Kotlin,Keystore,Undertow,我有以下财产档案: server: port: 8443 http2: enabled: true ssl: enabled: true key-store: classpath:keystore.p12 key-store-password: admin00 key-store-type: PKCS12 key-alias: tomcat 我在resources文件夹中有p12: 当我启动应用程序时,会显示此错误: Error s

我有以下财产档案:

server:
  port: 8443
  http2:
    enabled: true
  ssl:
    enabled: true
    key-store: classpath:keystore.p12
    key-store-password: admin00
    key-store-type: PKCS12
    key-alias: tomcat
我在resources文件夹中有p12:

当我启动应用程序时,会显示此错误:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-28 10:21:55.068 ERROR 8380 --- [           main] o.s.b.SpringApplication                  : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:keystore.p12'
我将p12复制到另一个文件夹(/mnt/d/KeyStores/)中:

我用以下方法进行测试: 密钥存储区:/mnt/d/KeyStores/keystore.p12

密钥存储:D:\KeyStores\keystore.p12

密钥存储:文件:/mnt/d/KeyStores/keystore.p12

密钥存储:文件:D:\KeyStores\keystore.p12

密钥存储:file:///D:/KeyStores/keystore.p12

密钥存储:file:///D://KeyStores//keystore.p12

密钥存储:file:///D:\KeyStores\keystore.p12

同样的结果。我在使用底拖:

package com.oesia.mako.config

import io.undertow.UndertowOptions
import org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class UndertowConfig {

    @Bean
    fun embeddedServletContainerFactory(): UndertowServletWebServerFactory {
        val factory = UndertowServletWebServerFactory()
        factory.addBuilderCustomizers(UndertowBuilderCustomizer { builder ->
            builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)
                    .setServerOption(UndertowOptions.HTTP2_SETTINGS_ENABLE_PUSH,true)
        })
        return factory
    }

}
我的gradle文件是:

buildscript {
    ext {
        kotlinVersion = '1.3.72'
        springBootVersion = '2.2.8.RELEASE'
        springDocVersion = '1.3.9'
        groovyVersion = '2.5.12'
        groovySpockVersion = '1.2-groovy-2.5'
        validationApiVersion = '2.0.1.Final'
        liquibaseCoreVersion = '3.6.3'
        liquibaseVersion = '2.0.1'
        myBatisVersion = '3.4.5'
        injectVersion = '1'
        gitPropertiesVersion = '1.4.21'
        plantUMLVersion = '0.1.+'
        keycloakVersion = '4.0.0.Final'
        keycloakUndertowVersion = '6.0.0'
        postgreSQLVersion = '42.2.5'
        alpnBootVersion = '8.1.13.v20181017'
        sl4jVersion = '1.7.25'
        testLoggerVersion = '1.6.0'
        gradleTestsetsVersion = '3.0.1'
    }
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
        classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
        classpath("be.jlr-home.gradle:plantumlPlugin:${plantUMLVersion}")
        classpath("com.adarshr.test-logger:com.adarshr.test-logger.gradle.plugin:${testLoggerVersion}")
        classpath("org.liquibase:liquibase-core:${liquibaseCoreVersion}")
        classpath("org.liquibase:liquibase-gradle-plugin:${liquibaseVersion}")
// Descomentar si se tiene git
//      classpath("gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:${gitPropertiesVersion}")
    }
}

apply plugin: 'maven-publish'
apply plugin: 'groovy'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'plantuml'
apply plugin: 'com.adarshr.test-logger'
apply plugin: 'liquibase'

group = 'com.oesia.mako'
rootProject.archivesBaseName = 'mako'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

repositories {
    mavenLocal()
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}

sourceSets {
    main {
        kotlin {
            srcDir 'src/main/kotlin'
            srcDir 'src/main/customized/kotlin'
            srcDir 'src/main/generated/kotlin'
        }
    }
    test {
        groovy {
            srcDir 'src/test/groovy'
        }
    }
}

configurations {
    all {
        exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
        exclude group: 'ch.qos.logback', module: 'logback-classic'
    }
}

dependencies {
    implementation("javax.inject:javax.inject:${injectVersion}")
    implementation("org.springdoc:springdoc-openapi-ui:${springDocVersion}")
    implementation("org.springdoc:springdoc-openapi-data-rest:${springDocVersion}")
    implementation("org.springdoc:springdoc-openapi-kotlin:${springDocVersion}")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
    implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
    implementation("javax.validation:validation-api:${validationApiVersion}")
    implementation("com.oesia.cleanarchitecture:commons-domain:+")
    implementation("com.oesia.cleanarchitecture:commons-infrastructure:+")
    implementation("com.oesia.mako:mako-rrhh-domain:+")
    implementation("com.oesia.mako:mako-rrhh-usecases:+")
    implementation("com.oesia.mako:mako-rrhh-adapter:+")
    implementation("com.oesia.mako:mako-rrhh-config:+")
    implementation("org.springframework.boot:spring-boot-starter-security")
    implementation("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:${springBootVersion}")
    implementation("org.springframework.boot:spring-boot-starter-hateoas")
    implementation("org.springframework.boot:spring-boot-starter-actuator")
    implementation("org.springframework.boot:spring-boot-starter-jdbc")
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("org.springframework.boot:spring-boot-starter-undertow")
    implementation("org.springframework.boot:spring-boot-starter-log4j2:${springBootVersion}")
    implementation("org.postgresql:postgresql:${postgreSQLVersion}")
    testRuntimeOnly("net.bytebuddy:byte-buddy:1.9.1")          // allows mocking of classes (in addition to interfaces)
    testRuntimeOnly("org.objenesis:objenesis:2.6")    // allows mocking of classes without default constructor (together with CGLIB)
    // Liquibase
    liquibaseRuntime("org.liquibase:liquibase-core:${liquibaseCoreVersion}")
    liquibaseRuntime("org.liquibase:liquibase-groovy-dsl:${liquibaseVersion}")
    liquibaseRuntime("ch.qos.logback:logback-core:1.2.3")
    liquibaseRuntime("ch.qos.logback:logback-classic:1.2.3")
    testImplementation("org.springframework.boot:spring-boot-starter-test")
    //implementation("org.keycloak:keycloak-spring-boot-2-starter:${keycloakVersion}")
    //implementation("org.keycloak:keycloak-undertow-adapter:${keycloakUndertowVersion}")
    testImplementation("org.codehaus.groovy:groovy-all:${groovyVersion}")
    testImplementation("org.spockframework:spock-core:${groovySpockVersion}")
    testImplementation("org.spockframework:spock-spring:${groovySpockVersion}")
    // optional dependencies for using Spock
    testImplementation("org.hamcrest:hamcrest-core:1.3") // only necessary if Hamcrest matchers are used
}

testlogger {
    // pick a theme - mocha, standard, plain, mocha-parallel, standard-parallel or plain-parallel
    theme 'mocha'
    // set to false to disable detailed failure logs
    showExceptions true
    // set threshold in milliseconds to highlight slow tests
    slowThreshold 2000
    // displays a breakdown of passes, failures and skips along with total duration
    showSummary true
    // set to false to hide passed tests
    showPassed true
    // set to false to hide skipped tests
    showSkipped true
    // set to false to hide failed tests
    showFailed true
    // enable to see standard out and error streams inline with the test results
    showStandardStreams false
    // set to false to hide passed standard out and error streams
    showPassedStandardStreams true
    // set to false to hide skipped standard out and error streams
    showSkippedStandardStreams true
    // set to false to hide failed standard out and error streams
    showFailedStandardStreams true
}

def changeLog = "./schema/ddl/database-changelog-master.yml"

task liquibaseDev {
    println "executing dev liquibase"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                url 'jdbc:postgresql://localhost:5432/mako'
                username 'mako'
                password 'mako'
            }
        }
    }    
}
task liquibaseInt {
    println "executing int liquibase"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                url 'jdbc:postgresql://localhost:5432/mako'
                username 'mako'
                password 'mako'
            }
        }
    }    
}
task liquibasePre {
    println "executing pre liquibase"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                url 'jdbc:postgresql://localhost:5432/mako'
                username 'mako'
                password 'mako'
            }
        }
    }    
}
task liquibasePro {
    println "executing pro liquibase"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                url 'jdbc:postgresql://localhost:5432/mako'
                username 'mako'
                password 'mako'
            }
        }
    }    
}

jacoco {
    toolVersion = "0.8.3"
    reportsDir = file("$buildDir/customJacocoReportDir")
}

jacocoTestReport {
    reports {
        xml.enabled false
        csv.enabled false
        html.destination file("${buildDir}/jacocoHtml")
    }
}

bootRun {
    if ( project.hasProperty('jvmArgs') ) {
        jvmArgs = (project.jvmArgs.split("\\s+") as List)
    }
}

plantuml {
    sourcePath = 'src/main/kotlin' +
            'src/main/customized/kotlin' +
            'src/main/generated/kotlin'
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }
}
如何使用Spring Boot 2.2.8和Undertow配置https?。我认为这在旧版本的Spring Boot中运行。http运行正常,只有https崩溃,因为不加载p12文件

我将p12更改为jks等效值,并产生相同的错误:

server:
  port: 8443
  http2:
    enabled: true
  ssl:
    key-store: classpath:keystore.jks    
    key-store-password: admin00
    key-store-type: JKS
    key-alias: tomcat
输出:

2020-06-29 10:21:55.915  WARN 12772 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.server.WebServerException: Could not 
load key store 'classpath:keystore.jks'
2020-06-29 10:21:55.981  INFO 12772 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-29 10:21:56.042 ERROR 12772 --- [           main] o.s.b.SpringApplication                  : Application run failed      

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:keystore.jks'
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[springc 
ontext-5.2.7.RELEASE.jar:5.2.7.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at com.oesia.mako.MakoApplicationKt.main(MakoApplication.kt:10) [main/:?]
Caused by: java.lang.IllegalStateException: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:keystore.jks'
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyManagers(SslBuilderCustomizer.java:125) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.customize(SslBuilderCustomizer.java:75) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.customizeSsl(UndertowServletWebServerFactory.java:252) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.createBuilder(UndertowServletWebServerFactory.java:239) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:220) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        ... 8 more
Caused by: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:keystore.jks'
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadStore(SslBuilderCustomizer.java:188) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadKeyStore(SslBuilderCustomizer.java:169) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyStore(SslBuilderCustomizer.java:143) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyManagers(SslBuilderCustomizer.java:110) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.customize(SslBuilderCustomizer.java:75) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.customizeSsl(UndertowServletWebServerFactory.java:252) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.createBuilder(UndertowServletWebServerFactory.java:239) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:220) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        ... 8 more
Caused by: java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:663) ~[?:1.8.0_211]
        at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56) ~[?:1.8.0_211]
        at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224) ~[?:1.8.0_211]
        at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70) ~[?:1.8.0_211]
        at java.security.KeyStore.load(KeyStore.java:1445) ~[?:1.8.0_211]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadStore(SslBuilderCustomizer.java:184) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.loadKeyStore(SslBuilderCustomizer.java:169) ~[spi 
ng-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyStore(SslBuilderCustomizer.java:143) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.getKeyManagers(SslBuilderCustomizer.java:110) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.SslBuilderCustomizer.customize(SslBuilderCustomizer.java:75) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.customizeSsl(UndertowServletWebServerFactory.java:252) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.createBuilder(UndertowServletWebServerFactory.java:239) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:220) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
        ... 8 more


> Task :bootRun FAILED

jks是腐败的。我用以下方法测试了jks:

keytool.exe -list -v -keystore keystore.jks 
keytool.exe -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 9650 -storepass admin00
我可以看到它被破坏了

然后我用以下方法重新生成jks:

keytool.exe -list -v -keystore keystore.jks 
keytool.exe -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 9650 -storepass admin00
我的财产是:

server:
  port: 8443
  http2:
    enabled: true
  ssl:
    enabled: true
    key-store: classpath:keystore.jks
    key-store-password: admin00
    key-store-type: JKS
    trust-store-type: JKS
    key-alias: tomcat
应用程序运行正常:

 __  __  _____  __ ___ _____     _____  _____  ___     _____  _____  _____  ____ 
/  \/  \/  _  \|  |  //  _  \   /  _  \/  _  \/___\   /  _  \/   __\/  ___>/    \
|  \/  ||  _  ||  _ < |  |  |   |  _  ||   __/|   |   |  _  <|   __||___  |\-  -/
\__ \__/\__|__/|__|__\\_____/   \__|__/\__/   \___/   \__|\_/\_____/<_____/ |__|
2020-07-08 17:54:14.735  INFO 4212 --- [           main] c.o.m.MakoApplicationKt                  : Starting MakoApplicationKt on DESKTOP-1MRHH61 with PID 4212 (D:\Workspaces\CleanArchitecture2\Mako\mako-rrhh-app\build\classes\kotlin\main started by jagilberte in D:\Workspaces\CleanArchitecture2\Mako\mako-rrhh-app)
2020-07-08 17:54:14.751  INFO 4212 --- [           main] c.o.m.MakoApplicationKt                  : The following profiles are active: dev
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/jagilberte/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.30/e606eac955f55ecf1d8edcccba04eb8ac98088dd/slf4j-simple-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/jagilberte/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.12.1/14973e22497adaf0196d481fb99c5dc2a0b58d41/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]   
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
2020-07-08 17:54:17.288  WARN 4212 --- [           main] i.u.w.jsr                                : UT026010: Buffer pool was 
not set on WebSocketDeploymentInfo, the default pool will be used
2020-07-08 17:54:17.322  INFO 4212 --- [           main] i.u.servlet                              : Initializing Spring embedded WebApplicationContext
2020-07-08 17:54:17.323  INFO 4212 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2482 ms
2020-07-08 17:54:18.606  INFO 4212 --- [           main] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is marked as final: Consider using interface-based JDK proxies instead!
2020-07-08 17:54:18.836  INFO 4212 --- [           main] o.s.s.c.ThreadPoolTaskExecutor           : Initializing ExecutorService 'applicationTaskExecutor'
2020-07-08 17:54:20.428  INFO 4212 --- [           main] o.s.s.w.DefaultSecurityFilterChain       : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@707f4647, org.springframework.security.web.context.SecurityContextPersistenceFilter@6644bdf5, org.springframework.security.web.header.HeaderWriterFilter@f44d033, org.springframework.security.web.authentication.logout.LogoutFilter@2c15034f, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@5ad40184, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7c9ea1d0, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7497a554, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4b8a0d03, org.springframework.security.web.session.SessionManagementFilter@25e95af1, org.springframework.security.web.access.ExceptionTranslationFilter@4a58e0e9, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2f75a9b1]
2020-07-08 17:54:20.528  INFO 4212 --- [           main] o.s.b.a.e.w.EndpointLinksResolver        : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-07-08 17:54:20.644  INFO 4212 --- [           main] i.undertow                               : starting server: Undertow 
- 2.0.30.Final
2020-07-08 17:54:20.653  INFO 4212 --- [           main] o.xnio                                   : XNIO version 3.3.8.Final  
2020-07-08 17:54:20.667  INFO 4212 --- [           main] o.x.nio                                  : XNIO NIO Implementation Version 3.3.8.Final
2020-07-08 17:54:20.782  INFO 4212 --- [           main] o.s.b.w.e.u.UndertowServletWebServer     : Undertow started on port(s) 8443 (https) with context path '/mako'
2020-07-08 17:54:20.788  INFO 4212 --- [           main] c.o.m.MakoApplicationKt                  : Started MakoApplicationKt 
in 6.811 seconds (JVM running for 9.946)
<==========---> 83% EXECUTING [3m 38s]
\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
/  \/  \/  _  \|  |  //  _  \   /  _  \/  _  \/___\   /  _  \/   __\/  ___>/    \

|\/| | | | | | | | | | | | | | | | | | | | | | | | | | | | |。我用以下方法测试了jks:

keytool.exe -list -v -keystore keystore.jks 
keytool.exe -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 9650 -storepass admin00
我可以看到它被破坏了

然后我用以下方法重新生成jks:

keytool.exe -list -v -keystore keystore.jks 
keytool.exe -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 9650 -storepass admin00
我的财产是:

server:
  port: 8443
  http2:
    enabled: true
  ssl:
    enabled: true
    key-store: classpath:keystore.jks
    key-store-password: admin00
    key-store-type: JKS
    trust-store-type: JKS
    key-alias: tomcat
应用程序运行正常:

 __  __  _____  __ ___ _____     _____  _____  ___     _____  _____  _____  ____ 
/  \/  \/  _  \|  |  //  _  \   /  _  \/  _  \/___\   /  _  \/   __\/  ___>/    \
|  \/  ||  _  ||  _ < |  |  |   |  _  ||   __/|   |   |  _  <|   __||___  |\-  -/
\__ \__/\__|__/|__|__\\_____/   \__|__/\__/   \___/   \__|\_/\_____/<_____/ |__|
2020-07-08 17:54:14.735  INFO 4212 --- [           main] c.o.m.MakoApplicationKt                  : Starting MakoApplicationKt on DESKTOP-1MRHH61 with PID 4212 (D:\Workspaces\CleanArchitecture2\Mako\mako-rrhh-app\build\classes\kotlin\main started by jagilberte in D:\Workspaces\CleanArchitecture2\Mako\mako-rrhh-app)
2020-07-08 17:54:14.751  INFO 4212 --- [           main] c.o.m.MakoApplicationKt                  : The following profiles are active: dev
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/jagilberte/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.30/e606eac955f55ecf1d8edcccba04eb8ac98088dd/slf4j-simple-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/jagilberte/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.12.1/14973e22497adaf0196d481fb99c5dc2a0b58d41/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]   
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
2020-07-08 17:54:17.288  WARN 4212 --- [           main] i.u.w.jsr                                : UT026010: Buffer pool was 
not set on WebSocketDeploymentInfo, the default pool will be used
2020-07-08 17:54:17.322  INFO 4212 --- [           main] i.u.servlet                              : Initializing Spring embedded WebApplicationContext
2020-07-08 17:54:17.323  INFO 4212 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2482 ms
2020-07-08 17:54:18.606  INFO 4212 --- [           main] o.s.a.f.CglibAopProxy                    : Unable to proxy interface-implementing method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is marked as final: Consider using interface-based JDK proxies instead!
2020-07-08 17:54:18.836  INFO 4212 --- [           main] o.s.s.c.ThreadPoolTaskExecutor           : Initializing ExecutorService 'applicationTaskExecutor'
2020-07-08 17:54:20.428  INFO 4212 --- [           main] o.s.s.w.DefaultSecurityFilterChain       : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@707f4647, org.springframework.security.web.context.SecurityContextPersistenceFilter@6644bdf5, org.springframework.security.web.header.HeaderWriterFilter@f44d033, org.springframework.security.web.authentication.logout.LogoutFilter@2c15034f, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@5ad40184, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7c9ea1d0, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7497a554, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4b8a0d03, org.springframework.security.web.session.SessionManagementFilter@25e95af1, org.springframework.security.web.access.ExceptionTranslationFilter@4a58e0e9, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2f75a9b1]
2020-07-08 17:54:20.528  INFO 4212 --- [           main] o.s.b.a.e.w.EndpointLinksResolver        : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-07-08 17:54:20.644  INFO 4212 --- [           main] i.undertow                               : starting server: Undertow 
- 2.0.30.Final
2020-07-08 17:54:20.653  INFO 4212 --- [           main] o.xnio                                   : XNIO version 3.3.8.Final  
2020-07-08 17:54:20.667  INFO 4212 --- [           main] o.x.nio                                  : XNIO NIO Implementation Version 3.3.8.Final
2020-07-08 17:54:20.782  INFO 4212 --- [           main] o.s.b.w.e.u.UndertowServletWebServer     : Undertow started on port(s) 8443 (https) with context path '/mako'
2020-07-08 17:54:20.788  INFO 4212 --- [           main] c.o.m.MakoApplicationKt                  : Started MakoApplicationKt 
in 6.811 seconds (JVM running for 9.946)
<==========---> 83% EXECUTING [3m 38s]
\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
/  \/  \/  _  \|  |  //  _  \   /  _  \/  _  \/___\   /  _  \/   __\/  ___>/    \

|\/| | | | | | | | | | | | | | | | | | | | | | | | | | | | |。它用于加载证书并启用SSL

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

org.springframework.boot
弹簧启动器webflux

Jusy包含此依赖项。它用于加载证书并启用SSL

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

org.springframework.boot
弹簧启动器webflux

提前感谢。但我解决了再生德杰克斯的问题。已损坏,这就是问题所在。提前感谢。但我解决了再生德杰克斯的问题。这就是问题所在。