java.net.ConnectException:连接超时(连接超时)

java.net.ConnectException:连接超时(连接超时),java,jenkins,Java,Jenkins,有一个APIGEE网关来调用端点,我在调用服务时将JKS文件加载到密钥库,我成功地从本地服务器获得了响应。但是当Jenkin的工作运行相同的代码时 "java.net.ConnectException: Connection timed out (Connection timed out)" error with the same proxy and certificates used. 这里可能有什么问题?什么样的改变可以解决詹金工作中的问题 谢谢你的帮助 已申请代理并在我的本地工作,没有

有一个APIGEE网关来调用端点,我在调用服务时将JKS文件加载到密钥库,我成功地从本地服务器获得了响应。但是当Jenkin的工作运行相同的代码时

 "java.net.ConnectException: Connection timed out (Connection timed out)" error with the same proxy and certificates used.
这里可能有什么问题?什么样的改变可以解决詹金工作中的问题

谢谢你的帮助

已申请代理并在我的本地工作,没有任何问题

下面的代码将帮助我返回SSLConfig和加载了它的JKS文件

public static SSLConfig getSSLConfig()引发IOException{
密钥库KeyStore=null;
SSLConfig config=null;
文件sslFile=新文件(“cx.p12”);
System.out.println(“SSL_文件::”+sslFile.getAbsolutePath());
试一试{
keyStore=keyStore.getInstance(“JKS”);
加载(新文件输入流(sslFile),
“test123.toCharArray());
如果(密钥库!=null){
org.apache.http.conn.ssl.SSLSocketFactory clientAuthFactory=new org.apache.http.conn.ssl.SSLSocketFactory(密钥库,“test123”);
config=new SSLConfig().with().sslSocketFactory(clientAuthFactory).和().allowlHostNames();
}
}捕获(例外情况除外){
System.out.println(“加载密钥库时出错>>>>>”;
例如printStackTrace();
}
返回配置;
}

//并且,将使用所需的
代理
SSLConfig
调用服务。这让我在当地取得了成功

EncoderConfig EncoderConfig=new EncoderConfig();
RestAssured.config=RestAssured.config().sslConfig(SSLHandshakeUtility.getSSLConfig());
Response Response=restarsured.given()。
日志()
.all()
.config(RestAssured.config().encoderConfig(encoderConfig.appendDefaultContentCharsetToContentTypeIfUndefined(false)))
.proxy(代理,端口)
.header(“内容类型”、“应用程序/json”)
.标题(“apiKey”,apiKey)
.header(“环境”、“开发”)
.车身(有效载荷)
.post(url);
预期:来自服务的响应类似于Jenkin作业中的本地运行


实际:
java.net.ConnectException:连接超时(连接超时)
来自Jenkin的作业。

问题是系统代理被传递到调用,我通过传递正确的代理和端口进行修复。问题是系统代理被传递到调用,我通过传递正确的代理和端口进行修复。