SSLHandshakeException Jhipster Okla &LetsEncrypt

SSLHandshakeException Jhipster Okla &LetsEncrypt

今天我尝试通过 Okta 使用 Oauth 连接配置一个新的 Jhipster 应用程序。

当我将我的 issuer-uri 放到本地主机时,一切正常,但是当我尝试使用我的域创建它时,它将不再工作......

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

我想我哪里做错了:这是我的 Spring 配置:

  security:
      oauth2:
          client:
              provider:
                  oidc:
                      issuer-uri: https://okta.4fitmusic.com/oauth2/default
              registration:
                  oidc:
                      client-id: {myId}
                      client-secret: {MySecret}

我在 Okta 上的设置:

Application label 4FitMusic
Application type Web
Allowed grant types -> Authorization Code

Login redirect URIs http://localhost:8080/login/oauth2/code/oidc    
Logout redirect URIs http://localhost:8080  
Login initiated by App Only
Initiate login URI http://localhost:8080/login

我见过几次类似的错误,我忘记了确切的异常消息,但我猜你没有填写 "Certificate Chain (optional)" 字段(对于这种类型,这实际上不是可选的证书)。

如果这不能解决问题,请检查您的 Java 版本,确保您使用的是最新版本的 Java 8(或更新版本),我认为至少是 8u101。