Napisałem następujący kod w PL/SQL dla wywoływania API innych firm z Oracle 11g.Certyfikat wysłany przez drugą stronę nie mógł zostać zatwierdzony - 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;
Kiedy uruchomić ten kod Dostaję następujący błąd
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.
zorientowali się, że jest to spowodowane „https” protocole. Pobrałem więc wszystkie odpowiednie certyfikaty, a następnie przekazałem je naszemu zespołowi DB. Chociaż skonfigurowali portfel Oracle z tymi certyfikatami, wciąż otrzymujemy ten sam raport o błędzie.
Jakieś myśli?
UPDATE: Dodałem następujący kod jako pierwszych wierszy rozpocząć bloku ...
UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(TRUE);
UTL_HTTP.SET_WALLET('file:/../wallet','pwd.....');
ale teraz daje następujący wyjątek „certyfikat jest nieważny”, chociaż nadawca certyfikat potwierdza ważność. Również ważność można potwierdzić, patrząc na ten zewnętrzny moduł sprawdzania pisowni: 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.
Należy pamiętać, że mam dość wszystkie formaty plików certyfikat (Base-64 kodowany/PKCS # 7 itd.) Jak wyjaśniono w http://oracle-base.com/articles/misc/utl_http-and-ssl.php
Wszelkie myśli?
zobacz ten wpis: http://stackoverflow.com/a/16081869/92837 – Sathya
@Sathya, w tym poście ustawili portfel na wywołanie kodu pll sql jak EXEC UTL_HTTP.set_wallet ('file:/u01/app/oracle/admin/DB11G/wallet ',' WalletPasswd123 '); Czy to musi być? – CAD
Jaka * dokładna * wersja bazy danych? Czy jest w pełni załatany? Który protokół/wersja używasz: SSLv3? TSLv1? Coś innego? – APC