0

After that I have found fix for this Exaptation,

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

fixed this Exaptation with code below:

request.config(RestAssured.config().sslConfig(new SSLConfig().allowAllHostnames().relaxedHTTPSValidation()));

I faced a problem can't to get token from response. I get 401 status code for authorization request, /token/missed. Have not idea why. 'cuz via Postman I should not set token in header for this request, request to get token. Probably somebody had faced this issue and know how to fix it?

   public EndPoints (String baseUrl) {
    RestAssured.baseURI = baseUrl;
    request = RestAssured.given();
    request.config(RestAssured.config().sslConfig(new SSLConfig().allowAllHostnames().relaxedHTTPSValidation()));
    request.header("Content-Type", "application/json");
    request.header("Accept","application/json");

}

public void authenticateUser(AuthorizationRequest authorizationRequest) {
    Response response = request.log().all().body(authorizationRequest).post(RoutApi.loginTo());             
Igor
  • 1
  • HTTP status 401 usually means that you are not authenticated. Either your credentials are wrong or you are not sending them correctly. – DarkMatter Jan 12 '21 at 08:25
  • yep, you was so right =) it's my mistake. Had incorrect path – Igor Jan 12 '21 at 11:26

0 Answers0