Ho scritto il seguente codice in PL/SQL per chiamare le API di terze parti da Oracle 11g.Il certificato inviato dall'altra parte non può essere convalidato - Oracle Wallet
Begin
-- preparing Request...
l_http_request := UTL_HTTP.begin_request ('https://www..........'
, 'GET'
, 'HTTP/1.1');
-- set header's attributes...
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'application/json');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(t_request_body));
UTL_HTTP.set_header(l_http_request, 'Api-Key','..............');
-- get Response and obtain received value
l_http_response := UTL_HTTP.get_response(l_http_request);
UTL_HTTP.read_text(l_http_response, l_response_text);
end;
Quando eseguo questo codice Sto ottenendo seguente errore
Error report:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-29024: Certificate validation failure
ORA-06512: at line 13
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.
ho capito che questo è causato da 'https' protocole. Così ho scaricato tutti i certificati pertinenti e poi li ho consegnati al nostro team di DB. Sebbene abbiano configurato il portafoglio Oracle con questi certificati, stiamo ancora ricevendo lo stesso rapporto di errore.
Qualche idea?
UPDATE: Ho aggiunto codice seguente come le prime righe di iniziare blocco ...
UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(TRUE);
UTL_HTTP.SET_WALLET('file:/../wallet','pwd.....');
Ma ora dà seguente eccezione "Certificato non valido", anche se il mittente certificato conferma il suo validità. Anche la validità potrebbe essere confermata osservando anche questo controllo ssl esterno: https://www.sslshopper.com.
Error report:
ORA-29024: Certificate validation failure
ORA-06512: at "SYS.UTL_HTTP", line 1128
ORA-06512: at line 16
29024. 00000 - "Certificate validation failure"
*Cause: The certificate sent by the other side could not be validated. This may occur if
the certificate has expired, has been revoked, or is invalid for another reason.
*Action: Check the certificate to determine whether it is valid. Obtain a new certificate,
alert the sender that there certificate has failed, or resend.
prega di notare che ho stanco tutti i formati di file di certificato (Base-64 encoded/PKCS # 7, ecc), come spiegato in http://oracle-base.com/articles/misc/utl_http-and-ssl.php
Qualche idea?
vedere questo post: http://stackoverflow.com/a/16081869/92837 – Sathya
@Sathya, in quel post hanno impostato il wallet dal chiamare il codice sql come EXEC UTL_HTTP.set_wallet ('file:/u01/app/oracle/admin/DB11G/wallet ',' WalletPasswd123 '); È un must? – CAD
Quale versione * precisa * del database? È completamente aggiornato? Quale protocollo/versione stai usando: SSLv3? TSLv1? Qualcos'altro? – APC