Search code examples
oracle-databaseapihttpsoracle12c

Oracle Error ORA-29273: HTTP request failed ORA-29259: end-of-input reached When Calling UTL_HTTP.request


I am trying to call a web service using the Oracle UTL_HTTP.request API. The call requires a proxy & wallet/certificate. I believe I have cleared up the certificate issues, since I no longer get a ORA-29024: Certificate validation failure error. Now I am getting ORA-29259: end-of-input reached error. I am using DBMS version 12.1.0.2.0, and should be using TLS 1.2 (not sure how to verify this).

The following call works perfectly & returns a JSON payload:

SELECT utl_http.request (
  'http://jsonplaceholder.typicode.com/todos/1',
  'proxy.myurl.com')
FROM dual;

Response:

{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}

The following call throws the ORA-29259 error:

SELECT utl_http.request (
  'https://service.baseurl.com/ping',
  'proxy.myurl.com',
  'file:/my/wallet/location',
  'mypassword'
 )
FROM DUAL;

Runtime exception stack:

ORA-29273: HTTP request failed
ORA-29259: end-of-input reached
ORA-06512: at "SYS.UTL_HTTP", line 1491
ORA-06512: at line 1

I have also tried calling UTL_HTTP.begin_request using an anonymous PL/SQL block, but get essentially the same ORA-29259 error as above.

DECLARE
  l_http_request utl_http.req;
  l_http_response utl_http.resp;
  l_text VARCHAR2(32767);
BEGIN
  utl_http.set_proxy('proxy.myurl.com');
  utl_http.set_wallet('file:/my/wallet/location'
                      ,'mypassword');
  l_http_request := utl_http.begin_request('https://service.baseurl.com/ping' 
                                           ,'POST', 'HTTP/1.1');
  l_http_response := utl_http.get_response(l_http_request);
  BEGIN
    LOOP
      utl_http.read_text(l_http_response, l_text, 32766);
      dbms_output.put_line(l_text);
    END LOOP;
  EXCEPTION WHEN utl_http.end_of_body THEN
    utl_http.end_response(l_http_response);
  END;
END;

ORA-29273: HTTP request failed
ORA-29259: end-of-input reached
ORA-06512: at "SYS.UTL_HTTP", line 1258
ORA-06512: at line 10

Any ideas on what could be causing this error?


Solution

  • I think your problem would be the missing cipher suits in 12.1c. You have to apply a on your database, security patch 24666032 and the minimum DBBP should be 12.1.0.2.160719 (23054246).

    After that, the database should add support for cipher.

    You can view this information on MOS:UTL_HTTP access to secured website fails with ORA-29259 in 12c database (Doc ID 2402276.1)

    Regards