1.导入Jsoup的依赖包
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.10.3</version>
</dependency>
2.添加SslUtils.java来忽略HTTPS请求的SSL证书
(不一定要这一步,这取决于你服务器的安全证书是否过期)
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
/**
*
* @ClassName: SslUtils
* @Description: 忽略HTTPS请求的SSL证书
* @author zhuth
* @date 2020年12月12日 上午11:27:27
*
*/
public class SslUtils