首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在12c上使用utl_http &wallet:证书验证失败

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

Stack Overflow用户
提问于 2013-10-15 11:28:18
回答 1查看 29K关注 0票数 12

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

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

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

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

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

代码语言:javascript
运行
复制
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  
Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.  
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并运行以下命令:

代码语言:javascript
运行
复制
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行

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

代码语言:javascript
运行
复制
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 );  
    dbms_output.put_line ( lo_resp.status_code );  
    utl_http.end_response ( lo_resp );  
end;  
/  

帮帮我,欧比万,你是我唯一的希望。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-22 20:44:54

为了别人的利益回答我自己的问题。

根据Oracle的支持,只应该导入证书链,而不是端站点证书。在上面使用的示例中,只将以下证书导入钱包:

Geotrust SSL CA & Geotrust Global CA

不导入*.presstogo.com证书

引用Oracle支持:

选择在12c中失败的原因是,12c不希望将钱包中的用户证书视为可信证书。 这显然不是以前版本的问题,但从钱包中删除证书就解决了这个问题。

这与我在网上找到的关于使用utl_http连接到Https站点的所有信息相矛盾,让我感到困惑。

希望这能对处于我这种情况的人有所帮助。

票数 26
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19380116

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档