【发布时间】:2019-11-05 12:01:13
【问题描述】:
我从服务器取回的证书有错误:
javax.net.ssl.SSLProtocolException:X.509 证书不完整: SubjectAlternativeName 扩展必须在主题时标记为关键 字段为空
我发现使用 RelaxedHTTPSValidation 可以忽略证书错误。
所以我尝试这样使用它:
@When("^Get All Applications Request Executed$")
public void getAllApplicationsRequestExecuted() {
response =
given()
.relaxedHTTPSValidation()
.log().all()
.spec(testContext().getRequestSpec())
.when()
.get("application/api/virtual-services/") //Send the request along with the resource
.then()
.extract()
.response();
testContext().setResponse(response);
}
另外,我添加了这个@Before 钩子:
@Before
public void setUseRelaxedHTTPSValidation(){
RestAssured.useRelaxedHTTPSValidation();
}
但我没有看到任何变化。
【问题讨论】:
标签: cucumber rest-assured