【问题标题】:Using utl_http & wallets on 12c: certificate validation failure在 12c 上使用 utl_http 和钱包:证书验证失败
【发布时间】:2013-10-23 04:36:39
【问题描述】:

希望有人能发现我做错了什么,因为我会因此秃顶。

我已经使用 utl_http 和钱包在 11gR1 上调用 https 没有太多麻烦,但是我们新的 12c 安装让我很伤心。

我尝试使用 oracle 钱包管理器和命令行导入受信任的证书,但没有成功。 我知道 oracle 在缓存钱包方面可能很挑剔,所以我尝试了多个新会话,但没有任何运气。

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

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

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 并运行以下命令:

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 );  
    dbms_output.put_line ( lo_resp.status_code );  
    utl_http.end_response ( lo_resp );  
end;  
/  

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

【问题讨论】:

    标签: oracle ssl plsql oracle12c


    【解决方案1】:

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

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

    Geotrust SSL CA & Geotrust Global CA

    不要导入 *.presstogo.com 证书

    引用 Oracle 支持:

    在 12c 中选择失败的原因是 12c 不想要 将钱包中的用户证书视为可信证书。

    这在以前的版本中显然不是问题,但删除 来自钱包的证书解决了这里的问题。

    这与我在网上找到的关于使用 utl_http 连接到 Https 站点的所有信息相矛盾,并且把我搞糊涂了。

    希望这将帮助其他人在我的情况。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-25
      • 1970-01-01
      • 2012-03-15
      • 2019-07-03
      • 1970-01-01
      • 2020-09-28
      • 2015-09-05
      • 2016-12-08
      相关资源
      最近更新 更多