zoukankan      html  css  js  c++  java
  • 基于【 bug解决】二 || Springboot整合mqtt协议导致的错误

    1、报错信息如下所示:

    by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching XXX found

    org.eclipse.paho.client.mqttv3.MqttException: MqttException
    	at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.2.jar:na]
    	at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:736) ~[org.eclipse.paho.client.mqttv3-1.2.2.jar:na]
    	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_251]
    Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching XXX found
    	at sun.security.ssl.Alerts.getSSLException(Alerts.java:198) ~[na:1.8.0_251]
    	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1967) ~[na:1.8.0_251]
    	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:331) ~[na:1.8.0_251]
    	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:325) ~[na:1.8.0_251]
    	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1689) ~[na:1.8.0_251]
    	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:226) ~[na:1.8.0_251]
    	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1082) ~[na:1.8.0_251]
    	at sun.security.ssl.Handshaker.process_record(Handshaker.java:1010) ~[na:1.8.0_251]
    	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1079) ~[na:1.8.0_251]
    	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388) ~[na:1.8.0_251]
    	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416) ~[na:1.8.0_251]
    	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400) ~[na:1.8.0_251]
    	at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:149) ~[org.eclipse.paho.client.mqttv3-1.2.2.jar:na]
    	at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:722) ~[org.eclipse.paho.client.mqttv3-1.2.2.jar:na]
    	... 1 common frames omitted
    Caused by: java.security.cert.CertificateException: No name matching sgacc.agrithings.cn found
    	at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:231) ~[na:1.8.0_251]
    	at sun.security.util.HostnameChecker.match(HostnameChecker.java:96) ~[na:1.8.0_251]
    	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:459) ~[na:1.8.0_251]
    	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:427) ~[na:1.8.0_251]
    	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:232) ~[na:1.8.0_251]
    	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[na:1.8.0_251]
    	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1671) ~[na:1.8.0_251]
    	... 10 common frames omitted
    

    百度上所有的解决方案都试了,最终发现是springboot版本导致的,测试了2.2.7和2.3.0版本,都报以上错误信息,改为2.2.4以下版本后正常。

    哪位大佬知道是什么原因导致的麻烦评论区回复下,非常感谢!

  • 相关阅读:
    H3BPM子表的复制
    vue规格新增一对多的例子
    vue自制switch滑块
    table垂直居中
    css清楚浮动的class
    网页之间的参数传递
    调用get_str_time(时间), 就能把毫秒的时间转换成格式化的 ,转化时间戳的方法
    css实现照片上传的加号框
    递归函数获得n个不重复的随机数
    随机生成n个不重复的数,范围是2-32,并让其在新页面打开
  • 原文地址:https://www.cnblogs.com/kevin-ying/p/13084652.html
Copyright © 2011-2022 走看看