При отправке API-запроса возникает ошибка: unable to find valid certification path to requested target
При отправке api-запроса на ресурс возникает ошибка:
"javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
Из-за чего это может быть?
package switchover;
import io.restassured.RestAssured;
import io.restassured.config.SSLConfig;
import io.restassured.response.Response;
import org.junit.Test;
import static io.restassured.RestAssured.given;
public class CheckLeader {
@Test
public void checkLeader(){
String certPath = "path";
String pass = "pass";
RestAssured.config = RestAssured.config().sslConfig(
new SSLConfig().keyStore(certPath, pass).trustStore(certPath, pass));
Response response = given()
.relaxedHTTPSValidation()
.config(RestAssured.config())
.get("path")
.then()
.statusCode(200)
.extract().response();
System.out.println(response.prettyPrint());
}
}