Hello team,
I am getting the below Error Message:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-29024: Certificate validation failure
ORA-06512: at line 33
Note:I added the Certificate in the wallet using orapki
DECLARE
req utl_http.req;
resp utl_http.resp;
value VARCHAR2(1024);
l_test_user VARCHAR2(30):
='[email protected]
';
l_test_pwd VARCHAR2(30):='xxxx123';
l_test_workspace NUMBER:=1234567;
l_json_auth_req CLOB;
l_test_auth_req UTL_HTTP.req;
l_test_auth_resp UTL_HTTP.resp;
l_resp_text CLOB;
g_wallet_loc VARCHAR2 (100) := FND_PROFILE.VALUE ('XX_GLOBAL_WALLET');
g_wallet_pwd VARCHAR2 (100) := FND_PROFILE.VALUE ('XX_GLOBAL_WALLET_PWD');
g_proxy_server VARCHAR2 (200) := FND_PROFILE.VALUE ('XX_WEB_PROXY_SERVER');
BEGIN
dbms_output.enable(40000);
UTL_HTTP.set_proxy (g_proxy_server);
UTL_HTTP.set_wallet (g_wallet_loc, g_wallet_pwd);
l_json_auth_req :=
'{
"email" : "'
|| l_test_user
|| '",
"password" : "'
|| l_test_pwd
|| '",
"spaceId" : "'
|| l_test_workspace
|| '"
}';
DBMS_OUTPUT.PUT_LINE('The JSON Auth'||l_json_auth_req);
l_test_auth_req:=UTL_HTTP.begin_request ('
https://api.testenvironment.com/login
', 'POST');
UTL_HTTP.set_header (l_test_auth_req, 'Content-Type', 'application/json');
UTL_HTTP.set_header (l_test_auth_req, 'Content-Length', LENGTH (l_json_auth_req));
UTL_HTTP.write_text (l_test_auth_req, l_json_auth_req);
l_test_auth_resp := UTL_HTTP.get_response (l_test_auth_req);
DBMS_OUTPUT.PUT_LINE ('Test AUTH Request:' || CHR (10) || l_json_auth_req);
DBMS_OUTPUT.PUT_LINE (l_test_auth_resp.status_code);
DBMS_OUTPUT.PUT_LINE (l_test_auth_resp.reason_phrase);
DBMS_OUTPUT.PUT_LINE ('Reading Test AUTH Response:');
BEGIN
LOOP
UTL_HTTP.read_line (l_test_auth_resp, l_resp_text, FALSE);
DBMS_OUTPUT.PUT_LINE ('Test AUTH Token Response:' || CHR (10) || l_resp_text);
END LOOP;
EXCEPTION
WHEN UTL_HTTP.end_of_body
THEN
--DBMS_OUTPUT.PUT_LINE('Exception while reading response:'||SQLCODE||'::'||SQLERRM);
UTL_HTTP.end_response (l_test_auth_resp);
END;
END;