我有一个 https api 我已经在我的 jdk 1.8 中插入了 cacerts 中的证书 当我点击
Response response1 = RestAssured.given().log().all().get("someurl").then().log().ifError().extract().response();
给予
javax.net.ssl.SSLException: Certificate for doesn't match any of the subject alternative names: [Some other domain name] Then i hit with relaxedHttpValidation and allowing all hostName
Response response = given().config(RestAssured.config().sslConfig(sslConfig().allowAllHostnames().relaxedHTTPSValidation())).log().all().get("someURL").then().log().ifError().extract().response();
它给出 503 服务不可用 我错过了什么吗
最佳答案
我找到了必须在请求中设置 sni-header 的解决方案。 请按照相同的github url https://github.com/rest-assured/rest-assured/pull/775
关于java - RestAssured 调用 https get api 给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41861749/