Home » SQL & PL/SQL » SQL & PL/SQL » ORA 12545 | UTL_HTTP (Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production)
icon1.gif  ORA 12545 | UTL_HTTP [message #685350] Wed, 15 December 2021 06:14 Go to next message
vippysharma
Messages: 73
Registered: May 2013
Location: www
Member
Hi Community,

Hope you are all doing good.

I tried below steps in my DB but final SQL giving me one exception, could anyone please have a look and suggest if something I missed.

/*
-- I exported all certificates from https://gb.redhat.com/ which I further added in wallet. (below steps)
*/
orapki wallet create -wallet /home/oracle/wlt_vip -pwd ***** -auto_login
orapki wallet add -wallet /home/oracle/wlt_vip -cert /home/oracle/RH_1.cer -trusted_cert -pwd *****
orapki wallet add -wallet /home/oracle/wlt_vip -cert /home/oracle/RH_2.cer -trusted_cert -pwd *****

EXEC UTL_HTTP.set_wallet('file:/home/oracle/wlt_vip', '*****');

SELECT utl_http.request('https://gb.redhat.com/') from dual;   -- Final SQL

ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1501
ORA-12545: Connect failed because target host or object does not exist
ORA-06512: at "SYS.UTL_HTTP", line 380
ORA-06512: at "SYS.UTL_HTTP", line 1441
ORA-06512: at line 1
We are not using any proxy in any of our browser.

Any lead will be appreciated. thanks !!

Re: ORA 12545 | UTL_HTTP [message #685351 is a reply to message #685350] Wed, 15 December 2021 07:12 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
It works for me:
orclz>
orclz> SELECT utl_http.request('https://gb.redhat.com',wallet_path=>'file:c:\tmp\wallet') from dual;

UTL_HTTP.REQUEST('HTTPS://GB.REDHAT.COM',WALLET_PATH=>'FILE:C:\TMP\WALLET')
-------------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<!--[if IE 8]><html lang="en" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
Which certificate did you load into the wallet? You need only one, the root certificate for DigiCert High Assurance EV Root CA
Re: ORA 12545 | UTL_HTTP [message #685353 is a reply to message #685351] Thu, 16 December 2021 00:42 Go to previous messageGo to next message
vippysharma
Messages: 73
Registered: May 2013
Location: www
Member
Except leaf I have loaded two certificates.

now, when I re-execute same SQL it show new error i.e. Unknown Error

SELECT utl_http.request('https://gb.redhat.com/') from dual;   -- Final SQL

ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1501
ORA-28750: unknown error
ORA-06512: at "SYS.UTL_HTTP", line 651
ORA-06512: at "SYS.UTL_HTTP", line 1443
ORA-06512: at line 1
Re: ORA 12545 | UTL_HTTP [message #685355 is a reply to message #685353] Thu, 16 December 2021 03:20 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I think it is a problem with release 12.2.0.1:
orclz>
orclz> select * from v$version;

BANNER
--------------------------------------------------------------------------------
BANNER_FULL
-----------------------------------------------------------------------------------------------------------------------------------------
BANNER_LEGACY                                                                             CON_ID
-------------------------------------------------------------------------------- ---------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production                         0


orclz> SELECT utl_http.request('https://gb.redhat.com',wallet_path=>'file:c:\tmp\wallet') from dual;

UTL_HTTP.REQUEST('HTTPS://GB.REDHAT.COM',WALLET_PATH=>'FILE:C:\TMP\WALLET')
-----------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<!--[if IE 8]><html lang="en" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
  <head>
127.0.0.1:1521/orclxpdb>
127.0.0.1:1521/orclxpdb> select * from v$version;

BANNER                                                                               CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production              0
PL/SQL Release 12.2.0.1.0 - Production                                                    0
CORE    12.2.0.1.0      Production                                                                0
TNS for 64-bit Windows: Version 12.2.0.1.0 - Production                                   0
NLSRTL Version 12.2.0.1.0 - Production                                                    0

127.0.0.1:1521/orclxpdb> SELECT utl_http.request('https://gb.redhat.com',wallet_path=>'file:c:\tmp\wallet') from dual;
SELECT utl_http.request('https://gb.redhat.com',wallet_path=>'file:c:\tmp\wallet') from dual
       *
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1501
ORA-28750: unknown error
ORA-06512: at "SYS.UTL_HTTP", line 651
ORA-06512: at "SYS.UTL_HTTP", line 1443
ORA-06512: at line 1
Your old release probably can't understand the cipher suite the certificate uses. You'll have to upgrade, 12.2.0.1 went out of premier support a year ago.
Re: ORA 12545 | UTL_HTTP [message #685385 is a reply to message #685355] Mon, 20 December 2021 03:32 Go to previous message
vippysharma
Messages: 73
Registered: May 2013
Location: www
Member
there is one workaround, it is working fine for me...

I have tried to call SENDGRID api, followed below steps...
1. Download certificates and loaded to oracle wallet.
2. Create ACL and then Assign to host.
3. Added Privileges to ACL.
4. Assign wallet to ACL using dbms_network_acl_admin.assign_wallet_acl.
5. EXEC UTL_HTTP.set_wallet('file:/u01/app/oracle/admin/DBName/wallet', '***WalletPwD**');
6. Now execute final SQL and https_Host (CN name) should be mandatory else error will be there.

select utl_http.request(url => 'https://api.sendgrid.com/v3/mail/send',
						wallet_path => 'file://u01/app/oracle/admin/DBName/wallet',
						wallet_password => '***WalletPwD**',
						https_host => '*.api.sendgrid.com'
						) resp 
from dual;

RESP
--------------
{"errors":[{"message":"POST method allowed only","field":null,"help":null}]}
Previous Topic: UTL_FILE
Next Topic: Flatten table to get unique VALUES
Goto Forum:
  


Current Time: Fri Mar 29 08:49:44 CDT 2024