使用Oracle SQL Developer通过https调用REST API [英] Calling REST APIs through https Using Oracle SQL Developer

查看:275
本文介绍了使用Oracle SQL Developer通过https调用REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Oracle PL / SQL开发的新手,我需要使用`UTL_HTTP`包从Oralce SQL Developer中调用几个第三方REST API(通过https)。在调用API时,Oracle显示以下错误消息...



*原因:无法验证另一方发送的证书。如果证书已过期,已被撤销或因其他原因无效,则可能发生这种情况。

*操作:检查证书以确定证书是否有效。获取新证书,

提醒发件人证明证书失败或重新发送。



所以我想,因为电话是HTTPS;我们需要在调用API之前将此SSL证书添加到Oracle Wallet。



我们应该在钱包中添加哪个证书?它是我们可以使用我们的浏览器作为* .cer文件下载的证书吗?

点击挂锁icone - >连接 - >证书信息 - >出口



即使我已经将这个证书添加到钱包中,但是没有工作并且给出了上述恐怖。



注意:我们正在使用Oracle 11g并使用Oralce SQL Developer来调用API。我们还在Oracle测试环境中启用了互联网访问。



这是一个示例API请求



req:= UTL_HTTP.BEGIN_REQUEST('https:// www.example.com/api/job/all','GET','HTTP / 1.1');



有什么想法吗?

I'm new to Oracle PL/SQL Development and I need to call few 3rd party REST APIs (Through https) from Oralce SQL Developer using `UTL_HTTP` package. When calling an API, Oracle shows the following error message...

*Cause: The certificate sent by the other side could not be validated. This may occur if
the certificate has expired, has been revoked, or is invalid for another reason.
*Action: Check the certificate to determine whether it is valid. Obtain a new certificate,
alert the sender that there certificate has failed, or resend.

So I guess that, since the call is https; we need to add this SSL certificate to Oracle Wallet before calling the API.

Which certificate that we should add to the wallet? Is it the certificate that we could download using our browser as a *.cer file?
Clicking padlock icone --> Connections--> Certificate Information --> Export

Even I've added this certificate to wallet its not working and giving the above arror.

Note: We are using Oracle 11g and use Oralce SQL Developer for calling APIs. Also we have enabled internet access in our Oracle testing envoronment.

This is a sample API request

req := UTL_HTTP.BEGIN_REQUEST('https://www.example.com/api/job/all', 'GET', 'HTTP/1.1');

Any thoughts?

推荐答案

您好请查看此 http://docs.oracle .com / cd / B14099_19 / core.1012 / b13995 / ssl_tr.htm [ ^ ]


这篇关于使用Oracle SQL Developer通过https调用REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆