1

我正在尝试使用“org.springframework.boot.devtools.RemoteSpringApplication”选项运行 Spring Boot Dev Tools 来远程调试我的应用程序,如下所述:
https ://docs.spring.io/spring-boot/docs/current /reference/html/using.html#using.devtools.remote-applications
它开始正常。我运行服务器应用程序并等待它完全启动。然后我从 STS4 (Eclipse) 运行远程 DevTools 配置,它可以正常启动,没有任何问题。我在控制台中看到:

  .   ____          _                                              __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _          ___               _      \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` |        | _ \___ _ __  ___| |_ ___ \ \ \ \
 \\/  ___)| |_)| | | | | || (_| []::::::[]   / -_) '  \/ _ \  _/ -_) ) ) ) )
  '  |____| .__|_| |_|_| |_\__, |        |_|_\___|_|_|_\___/\__\___|/ / / /
 =========|_|==============|___/===================================/_/_/_/
 :: Spring Boot Remote ::  (v2.5.4)

2021-09-05 19:47:06.731  INFO 11196 [           main] o.s.b.StartupInfoLogger                  : Starting RemoteSpringApplication v2.5.4 using Java 1.8.0_262 on MY-PC with PID 11196 (C:\.m2\repository\org\springframework\boot\spring-boot-devtools\2.5.4\spring-boot-devtools-2.5.4.jar started by ...)
2021-09-05 19:47:06.742  INFO 11196 [           main] o.s.b.SpringApplication                  : The following profiles are active: server
2021-09-05 19:47:16.148  INFO 11196 [           main] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2021-09-05 19:47:16.165  INFO 11196 [           main] o.s.b.StartupInfoLogger                  : Started RemoteSpringApplication in 9.923 seconds (JVM running for 11.966)

我的问题是,当我将客户端应用程序连接到服务器时,我在 DevTools 的控制台中收到以下异常:

Exception in thread "File Watcher" java.lang.IllegalStateException: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching localhost found
    at org.springframework.boot.devtools.remote.client.ClassPathChangeUploader.onApplicationEvent(ClassPathChangeUploader.java:97 undefined)
    at org.springframework.boot.devtools.remote.client.ClassPathChangeUploader.onApplicationEvent(ClassPathChangeUploader.java:59 undefined)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176 undefined)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169 undefined)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143 undefined)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421 undefined)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378 undefined)
    at org.springframework.boot.devtools.classpath.ClassPathFileChangeListener.publishEvent(ClassPathFileChangeListener.java:67 undefined)
    at org.springframework.boot.devtools.classpath.ClassPathFileChangeListener.onChange(ClassPathFileChangeListener.java:63 undefined)
    at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.fireListeners(FileSystemWatcher.java:329 undefined)
    at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.updateSnapshots(FileSystemWatcher.java:323 undefined)
    at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.scan(FileSystemWatcher.java:283 undefined)
    at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.run(FileSystemWatcher.java:263 undefined)
    at java.lang.Thread.run(Thread.java:748 undefined)
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching localhost found
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:198 undefined)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1967 undefined)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:331 undefined)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:325 undefined)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1688 undefined)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:226 undefined)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1082 undefined)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:1010 undefined)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1079 undefined)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388 undefined)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416 undefined)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400 undefined)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559 undefined)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185 undefined)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:167 undefined)
    at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76 undefined)
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48 undefined)
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66 undefined)
    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:109 undefined)
    at org.springframework.boot.devtools.remote.client.HttpHeaderInterceptor.intercept(HttpHeaderInterceptor.java:57 undefined)
    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:93 undefined)
    at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:77 undefined)
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48 undefined)
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66 undefined)
    at org.springframework.boot.devtools.remote.client.ClassPathChangeUploader.performUpload(ClassPathChangeUploader.java:110 undefined)
    at org.springframework.boot.devtools.remote.client.ClassPathChangeUploader.onApplicationEvent(ClassPathChangeUploader.java:94 undefined)
    ... 13 more
Caused by: java.security.cert.CertificateException: No name matching localhost found
    at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:237 undefined)
    at sun.security.util.HostnameChecker.match(HostnameChecker.java:97 undefined)
    at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:462 undefined)
    at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:442 undefined)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:209 undefined)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132 undefined)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1670 undefined)
    ... 34 more
4

0 回答 0