2013-10-15 5 views
7

Spero che qualcuno possa individuare ciò che sto facendo di sbagliato mentre sto diventando calvo.Utilizzo di utl_http e portafogli su 12c: errore di convalida del certificato

Ho usato utl_http & portafogli per chiamare https su 11gR1 senza troppi problemi, ma la nostra nuova installazione 12c mi sta causando un sacco di dolore.

Ho provato a importare il certificato attendibile utilizzando sia il gestore di portafoglio di Oracle che la riga di comando, senza alcun successo. So che l'oracolo può essere pignolo per il caching del portafoglio, quindi ho provato diverse nuove sessioni senza fortuna.

Ho scaricato i tre certificati necessari per * .presstogo.com, Geotrust SSL CA & Geotrust Global CA.

La versione a linea di comando del mio palazzo del portafoglio è la seguente:

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 

Ok, consente di test di questa. Login per sqlplus ed eseguire il seguente:

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; 

DECLARE

*

ERRORE alla linea 1:

ORA-29273: HTTP richiesta non è riuscita

ORA-06512: alla "SYS.UTL_HTTP", riga 1130

ORA-29024: errore di convalida del certificato ure

ORA-06512: alla linea 6

Per la cronaca, Vale la pena notare che il seguente funziona:

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; 
/ 

Aiutami Obi-Wan, sei la mia unica speranza .

risposta

17

Rispondere alla mia domanda a beneficio degli altri.

In base al supporto Oracle, è necessario importare solo la catena di certificati, non il certificato del sito finale. Nell'esempio ho usato in precedenza, solo importare i seguenti certificati nel portafoglio:

Geotrust SSL CA & Geotrust Global CA

Non importare il certificato * .presstogo.com

Per citare il supporto Oracle:

Il motivo per cui la selezione ha esito negativo in 12c è che 12c non vuole vedere l'utente cert nel portafoglio come un certificato attendibile.

Questo apparentemente non era un problema nelle versioni precedenti, ma la rimozione di che cert dal portafoglio risolto il problema qui.

Questo contraddice tutte le informazioni che ho trovato online riguardo l'uso di utl_http per connettersi ai siti Https e mi hanno confuso.

Speriamo che questo aiuti gli altri nella mia situazione.

Problemi correlati