Home » SQL & PL/SQL » SQL & PL/SQL » HTTPS Webservices Issue though PL/SQL (12.1.0.2)
HTTPS Webservices Issue though PL/SQL [message #656258] Fri, 30 September 2016 12:02 Go to next message
jeganr
Messages: 1
Registered: September 2016
Junior Member
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!!!
Re: HTTPS Webservices Issue though PL/SQL [message #656259 is a reply to message #656258] Fri, 30 September 2016 12:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
https://community.oracle.com/thread/3977170
Re: HTTPS Webservices Issue though PL/SQL [message #656260 is a reply to message #656258] Fri, 30 September 2016 12:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.

ORA-29024: 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 the certificate has failed, or resend.
John gave you the answer in OTN, as he said, problem and solution are external to Oracle, what do you expect in another Oracle forum?

Re: HTTPS Webservices Issue though PL/SQL [message #656264 is a reply to message #656258] Fri, 30 September 2016 12:55 Go to previous message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Do it the way I demo'ed it here,
http://www.skillbuilders.com/webinars/webinar.cfm?id=148&w=How-to-Get-Secure-Web-Services-(SSL/HTTPS)-and-Oracle-APEX-Working
and do NOT import the leaf certificate into the wallet.
Previous Topic: Multiple inline query
Next Topic: How to get rolling week count
Goto Forum:
  


Current Time: Fri Mar 29 01:03:18 CDT 2024