I'm trying to integrate an external service (Autenticação.gov preprod API) from Oracle APEX using apex_web_service.make_rest_request, but I'm getting SSL certificate validation errors when calling the HTTPS endpoint.
I've already tried disabling SSL verification and using different APEX/UTL_HTTP settings, but the error persists.
DECLARE
l_response CLOB;
l_status NUMBER;
l_json_obj JSON_OBJECT_T;
l_json_array JSON_ARRAY_T;
l_url VARCHAR2(4000) := 'https://preprod.autenticacao.gov.pt/oauthresourceserver/api/AttributeManager';
BEGIN
l_json_array := JSON_ARRAY_T();
l_json_array.append('NIF');
l_json_obj := JSON_OBJECT_T();
l_json_obj.put('token', :token);
l_json_obj.put('attributesName', l_json_array);
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json';
l_response := apex_web_service.make_rest_request(
p_url => l_url,
p_http_method => 'POST',
p_body => l_json_obj.to_string);
l_status := apex_web_service.g_status_code;
htp.p(l_status);
END;
Initial error:
HTTP Status Code: 555
Error Code: ORDS-25001
SQL Error Code: 29273
ORA-29273: HTTP request failed
ORA-29024: Certificate validation failure
After trying to disable SSL check:
PLS-00302: component 'SET_WALLET' must be declared
PLS-00302: component 'G_REQUEST_SECURE' must be declared
When trying UTL_HTTP.set_verify_peer / set_verify_depth:
PLS-00302: component 'SET_VERIFY_PEER' must be declared
PLS-00302: component 'SET_VERIFY_DEPTH' must be declared
What I have tried
-
Verified the target URL (https://preprod.autenticacao.gov.pt/...) — works fine in browser.
-
Attempted to disable SSL certificate validation using APEX settings (apex_web_service.set_wallet, g_request_secure), but those properties don’t exist in my APEX version.
-
Tried UTL_HTTP.set_verify_peer(FALSE) and UTL_HTTP.set_verify_depth(0) — got PLS-00302 (no privileges or component not found).
-
From my understanding, the error is due to Oracle not trusting the remote SSL certificate → ORA-29024.
Environment
-
Oracle APEX version: 24.x (APEX_240200)