英文:
Karate throwing error in Gloo API gateway and there is no proxy
问题
我们所有的全新API都在Gloo微网关中,所以当我尝试与Karate连接时,它会抛出“java.net.socketexception”错误,但在Postman中同样的事情运行正常。
没有设置代理。
所以在Karate中,我们是否有一个使用案例,成功触发了Gloo微网关后面的API?
对于我们在GCP中的所有API,这是一个阻碍。任何见解都将非常有帮助。
Gloo网络后面的API应该在Karate中正常工作。
英文:
Our All new API's are in Gloo micro Gateway, so when I am trying to connect it with karate, it is throwing the error "java.net.socketexception" but the same thing is working fine in postman.
There is no proxy set as such.
So in Karate do we have a use case where we have successfuly triggered the API behind the gloo micro gateway?
This a blocker for us for all the API in GCP. Any insights will be very helpfull.
The API behind Gloo network should work properly in Karate
答案1
得分: 0
通常这种问题是因为你使用了HTTP代理,或者服务器没有网络连接。关于代理配置,请参考这个答案:https://stackoverflow.com/a/59678094/143475
如果涉及网络问题,请寻求本地IT人员的帮助。
有一种罕见的情况是即使你 * configure ssl = true
,服务器也会非常严格地验证证书。在这种情况下,请继续阅读。
为了让其他人受益,将评论中的解决方案粘贴如下:
严格禁止绕过SSL,所以 * configure ssl = true 抛出了错误。所以我需要在JVM中导入一些证书,并在特定API的特性文件中将 * configure ssl = false(因为其他API需要绕过SSL,所以我没有在配置文件中更改 * configure ssl = true])。
对于那些想了解如何在Karate中配置证书的详细信息,请访问:https://github.com/karatelabs/karate#x509-certificate-authentication
请注意,* configure ssl = false
(或true
)可以在测试中的任何时候进行。这意味着即使你选择在 karate-config.js
中进行“全局”设置,你也可以在特定的 Feature
或 Scenario
中覆盖它。
英文:
Usually this kind of issue is because you have an HTTP proxy or because there is no network connectivity to the server. For proxy configuration, refer to this answer: https://stackoverflow.com/a/59678094/143475
For network issues please take the help of your local IT folks.
There is a rare chance that the server is very strict about certificates even if you * configure ssl = true
. In that case, read on.
For the benefit of others, pasting the solution from the comments thread:
> there was a strict policy not to bypass the SSL, so * configure ssl = true was throwing the error. So I need to import some certs in the JVM and make the * configure ssl = false in the feature file for that particular API ( since other API need to bypass ssl so I havnt changed * configure ssl = true] in config file).
For those looking for details on how to configure certificates in Karate: https://github.com/karatelabs/karate#x509-certificate-authentication
Note that * configure ssl = false
(or true
) can be done any time within a test. This means even if you choose to set it "globally" in karate-config.js
you could over-ride it in specific Feature
-s or Scenario
-s.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论