1

I'm trying to connect to the Royal Mail SOAP API but can't get past the the begin request stage.

Certificates have been added to the wallet, it works fine for DPD and other Web APIs.

DECLARE
    wk_http_request utl_http.req;
BEGIN
    utl_http.set_wallet('file:/app/oracle/admin/A11/wallet', NULL);
    wk_http_request := utl_http.begin_request('https://api.royalmail.net/shipping/v2', 'POST', utl_http.http_version_1_1);
END;
/  

Gives Error:

ORA-29259: end-of-input reached
ORA-06512: at "SYS.UTL_HTTP", line 1128
ORA-06512: at line 5
29259. 00000 -  "end-of-input reached"
*Cause:    The end of the input was reached.
*Action:   If the end of the input is reached prematurely, check if the input
           source terminates prematurely.  Otherwise, close the connection
           to the input.

I get the same whether I include the set wallet line or not.

This runs without error:

DECLARE
    wk_http_request utl_http.req;
BEGIN
    utl_http.set_wallet('file:/app/oracle/admin/A11/wallet', NULL);
    wk_http_request := utl_http.begin_request('https://api.dpd.co.uk', 'POST', utl_http.http_version_1_1);
END;
/

Can anyone connect to the Royal Mail API via Oracle PL/SQL? Our version is 11.2.0.3.0.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Nick S
  • 11
  • 1
  • 1
  • 2

1 Answers1

2

I'm facing the same error with Oracle DB 11.2.0.4 and trying to connect oracle ERP Cloud and oracle Integration Cloud Service.

My research concluded that Oracle 11g need to be patched in order to use TLS 1.2 according to this link.

Here's the list of TLS certificates that royalmail handles

List of TLS supported by https://api.royalmail.net

And here's the list of TLS certificates that api.dpd.co.uk handles

List of TLS supported by https://api.dpd.co.uk

Oracle 11g initially doesn't work with TLS 1.2, so you need to patch your DB in order to use this certificate.

Hope this may be helpul.

  • Thanks Jorge, I have another test database now built with 11.2.0.4 and we have applied the patch to handle TLS 1.2. That gets us past this problem. I'm now getting "Invalid Certificate" error even though we have all certificates in the Oracle Wallet. – Nick S Apr 18 '19 at 18:03
  • Are you getting the ORA-29024 error ?, If so, then according to the documentation, you should check the certificate to determine whether it is valid, check to ensure that the server's wallet has the appropriate trust points to validate the client's certificate, or ensure that the certificate has not been revoked (re download the certificates). Also I think this link may be helpful https://oracle-base.com/articles/misc/utl_http-and-ssl. I wish you luck !! – Jorge Rojas Z. Apr 22 '19 at 15:05
  • Thanks Jorge that looks a useful link I will give everything it a suggests a try. We did come up with a workaround via a reverse proxy server. – Nick S Apr 25 '19 at 07:47