添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

在12c上使用utl_http &wallet:证书验证失败

内容来源于 Stack Overflow,遵循 CC BY-SA 4.0 许可协议进行翻译与使用。IT领域专用引擎提供翻译支持

腾讯云小微IT领域专用引擎提供翻译支持

原文
Stack Overflow用户 提问于2013-10-15

希望有人能在我秃顶的时候发现我做错了什么。

我已经使用utl_http &钱包调用了11gR1上的https,没有太多麻烦,但是我们新的12c安装给我带来了很多麻烦。

我尝试过使用oracle钱包管理器和命令行导入受信任的证书,但没有成功。我知道甲骨文可以挑剔的缓存钱包,所以我尝试了多次新的会议没有任何运气。

我已经下载了*.presstogo.com的三个必要证书,Geotrust SSL和Geotrust Global。

我的建筑钱包的命令行版本如下:

orapki wallet create -wallet /oracle/product/12.0.1/owm/wallets/test1237 -pwd test=1237 -auto_login  
orapki wallet add -wallet /oracle/product/12.0.1/owm/wallets/test1237 -trusted_cert -cert "*.presstogo.com" -pwd test=1237  
orapki wallet add -wallet /oracle/product/12.0.1/owm/wallets/test1237 -trusted_cert -cert "GeoTrust SSL CA" -pwd test=1237  
orapki wallet add -wallet /oracle/product/12.0.1/owm/wallets/test1237 -trusted_cert -cert "Geotrust Global CA" -pwd test=1237  
orapki wallet display -wallet /oracle/product/12.0.1/owm/wallets/test1237   
Oracle PKI Tool : Version 12.1.0.1  
Requested Certificates:   
User Certificates:  
Trusted Certificates:   
Subject:        OU=Class 3 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US  
Subject:        CN=GTE CyberTrust Global Root,OU=GTE CyberTrust Solutions\, Inc.,O=GTE Corporation,C=US  
Subject:        CN=GeoTrust SSL CA,O=GeoTrust\, Inc.,C=US  
Subject:        OU=Class 2 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US  
Subject:        OU=Class 1 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US  
Subject:        CN=GeoTrust Global CA,O=GeoTrust Inc.,C=US  
Subject:        CN=*.presstogo.com,OU=IT,O=Press to go AS,L=Oslo,ST=Norway,C=NO,SERIAL_NUM=SJYpOHrRdCDHE8KZ6dRFGMJthOjs7-v3  

好吧,让我们来测试一下。登录到sqlplus并运行以下命令:

declare  
    lo_req    utl_http.req;  
    lo_resp   utl_http.resp;  
begin  
    utl_http.set_detailed_excp_support ( true );  
    utl_http.set_wallet ( 'file:/oracle/product/12.0.1/owm/wallets/test1237', 'test=1237');  
    lo_req := utl_http.begin_request ( 'https://production.presstogo.com/mars/hello' );  
    lo_resp := utl_http.get_response ( lo_req );  
    -- A successfull request would have the status code "200".   
    dbms_output.put_line ( lo_resp.status_code );  
    utl_http.end_response ( lo_resp );  
exception  
  when others then    
    utl_http.end_response ( lo_resp );  
    raise;  
end;  

申报

*

第1行中的错误:

ORA-29273: HTTP请求失败

ORA-06512:"SYS.UTL_HTTP",第1130行

ORA-29024:证书验证失败

ORA-06512:在第6行

值得注意的是,以下几点确实有效:

declare  
    lo_req    utl_http.req;  
    lo_resp   utl_http.resp;  
begin  
    utl_http.set_wallet ( 'file:/oracle/product/12.0.1/owm/wallets/test1237', 'test=1237');  
    lo_req := utl_http.begin_request ( 'https://www.google.be' );  
    lo_resp := utl_http.get_response ( lo_req );