Spring Boot RestTemplate 绕过HTTPS证书验证--解决https证书报错
1.Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request p… sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target… 调用微信端获取openid的接口结果一直报https证书的问题,明明之前都已经获得了openid,结果不知道为什么又给报这个错。。。。。令人头秃。找了好多博客最后也忘了是借鉴哪位大佬的解决了问题。 解决方法如下: 1.在com.httpclient包下创建一个SSL类代码如下 package com . httpclient ; import org . springframework . http . client . SimpleClientHttpRequestFactory ; import javax . net . ssl . * ; import java . io . IOException ; import java . net . HttpURLConnection ; import java . security .