获取javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException

问题描述 投票:1回答:1

我正在尝试使用空手道工具进行休息API测试。

我在pom.xml中设置了以下依赖项的Karate

<dependency>
    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-apache</artifactId>
    <version>0.7.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>com.intuit.karate</groupId>
    <artifactId>karate-junit4</artifactId>
    <version>0.7.0</version>
    <scope>test</scope>
</dependency>

功能如下所示。

Feature: test get

Scenario: get method
Given url 'https://xxxxxx.com'
When method GET
Then status 200

当我执行此操作时,我得到了

com.intuit.karate.exception.karateexceprion:java.net.UnknownHostException:xxxxxxx.com

相同的脚本可以正常工作而无需连接到VPN。

我在文件夹结构中没有classpath,karate-config.js。那有关系吗?

我试图测试的网站是https,并且具有身份验证弹出/启动屏幕,用户需要输入凭据。一旦用户输入此内容,他就会获得主页。

应该为此启用ssl吗?如果是这样的话?

我试图指定代理和端口

Feature: test get
Background:
    *configure proxy = {url:'proxy:port',username:'user',password:'password') 

Scenario: get method
    Given url 'https://xxxxxx.com'
    When method GET
    Then status 200

现在* configure proxy = {url:'proxy:port',用户名:'user',密码:'password')和给定的url'https://xxxxxx.com'通过但是当方法GET失败时出错

javax.net.ssl.SSL.HandshakeException:sun.security.validator.ValidatorException: PKIX path building failed: sun.securoty.provider.certpath.SunCertPathBuilderException: unable to find valid certication path to requested target.

请建议需要做什么

automation junit4 bdd intuit karate
1个回答
0
投票

相同的脚本可以正常工作而无需连接到VPN。

显然问题是因为您没有与谷歌的网络连接。试试ping。这根本不是空手道问题。

我的建议是忘记谷歌并开始尝试连接到您实际需要测试的服务器。

© www.soinside.com 2019 - 2024. All rights reserved.