Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HTTPS Webservices Issue though PL/SQL

3216164Sep 30 2016 — edited Oct 1 2016

Experts,

Need help to resolve issues with accessing HTTPS webservices through PL/SQL

I'm on Oracle DB 12.1.0.2.

I did the below steps before accessing webservices through PL/SQL

orapki wallet create -wallet LABEL_GEN

orapki wallet add -wallet LABEL_GEN -trusted_cert -cert 'cert_file' -pwd password

orapki wallet add -wallet LABEL_GEN -trusted_cert -cert 'cert_file' -pwd password

orapki wallet add -wallet LABEL_GEN -trusted_cert -cert 'cert_file' -pwd password

orapki wallet display -wallet LABEL_GEN -pwd password

Code below worked perfectly fine when I did the above steps but it is failing after a disconnect/reconnect to the database session. Please check the code and error below.

DECLARE

lo_req  UTL_HTTP.req;

    lo_resp UTL_HTTP.resp;

    BEGIN

    UTL_HTTP.SET_WALLET ('file:WALLET_PATH','password');

    lo_req := UTL_HTTP.begin_request('https://..URL..');

    lo_resp := UTL_HTTP.get_response(lo_req);

    dbms_output.put_line(lo_resp.status_code);

    --dbms_output.put_line(lo_resp);

    UTL_HTTP.end_response(lo_resp);

  END;

  /

Error report -

ORA-29273: HTTP request failed

ORA-29024: Certificate validation failure

ORA-06512: at "SYS.UTL_HTTP", line 368

ORA-06512: at "SYS.UTL_HTTP", line 1118

ORA-06512: at line 6

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.

Any inputs to this would be highly appreciated!!!

This post has been answered by gdanby on Oct 1 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2016
Added on Sep 30 2016
8 comments
11,913 views