【发布时间】:2021-05-15 10:18:30
【问题描述】:
错误是: sun.security.validator.ValidatorException: PKIX 路径验证失败:java.security.cert.CertPathValidatorException:时间戳检查失败
使用的代码是:
create or replace and compile java source named sendsms as
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class HttpsCall {
public static void main(String[] args) throws Exception {
String httpsURL = "https://www.jawalbsms.ws/api.php/sendsms?user=abc&pass=xyz&to=9665555555555&message=good morning&sender=abc";
URL myUrl = new URL(httpsURL);
HttpsURLConnection conn = (HttpsURLConnection) myUrl.openConnection();
InputStream is = conn.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String inputLine;
while ((inputLine = br.readLine()) != null) {
System.out.println(inputLine);
}
br.close();
} }
【问题讨论】: