【发布时间】:2020-05-23 13:34:51
【问题描述】:
我在 PL/SQL 中发出 POST 请求,但遇到了Certificate validation failure 错误。如果我在数据库之外运行它,在 cURL 或 Postman 中都可以正常工作。
在后面的程序中,我需要指定客户端证书、私钥和 CA 证书。在 cURL 中,我使用 --cert、--key 和 --cacert。
在 PL/SQL 中运行时,我只能指定存储这些文件的钱包,但我似乎没有指定要使用哪个证书和密钥的选项,我认为这就是我的原因我有问题吗?
declare
req utl_http.req;
res utl_http.resp;
url varchar2(4000) := 'https://server/';
buffer varchar2(4000);
begin
utl_http.set_wallet('file:wallet_path');
req := utl_http.begin_request(url,'POST');
utl_http.set_header(req,'header_name','header_text');
res := utl_http.get_response(req);
begin
loop
utl_http.read_line(res, buffer);
dbms_output.put_line(buffer);
end loop;
utl_http.end_response(res);
exception when utl_http.end_of_body then
utl_http.end_response(res);
end;
end;
/
【问题讨论】:
-
你的钱包里有你页面的证书(
https://server/)吗? -
@hotfix 我的钱包里有
https://server/和 ca 证书
标签: oracle post plsql https oracle-wallet