cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

S/4HANA Cloud get SSL Handshake error while calling API

Neil_Lee_057
Explorer
0 Likes
466

Dear Experts,

Environment: SAP S/4HANA CLOUD 2502

I call an API by postman with get method success,

https://cpx.cbc.gov.tw/API/DataAPI/Get?FileName=BP01D01

 Neil_Lee_057_0-1740982226901.png

but get exception while using abap code in s/4hana cloud as below

--> SSL handshake with cpx.cbc.gov.tw:443 failed after 421

Neil_Lee_057_1-1740982273917.png

 

 METHOD if_oo_adt_classrun~main.

    " Create HTTP client; send request
    TRY.
        DATA(lo_destination) = cl_http_destination_provider=>create_by_url(
            'https://cpx.cbc.gov.tw/API/DataAPI/Get' ).

        DATA(lo_http_client) = cl_web_http_client_manager=>create_by_http_destination( i_destination = lo_destination ).
        DATA(lo_request) = lo_http_client->get_http_request( ).

        lo_request->set_query( query = 'FileName=BP01D01' ).

        DATA(lo_response) = lo_http_client->execute( i_method = if_web_http_client=>get ).
        DATA(lv_json_results) = lo_response->get_text( ).

      CATCH cx_root INTO DATA(lx_exception).
        out->write( lx_exception->get_text( ) ).
    ENDTRY.

  ENDMETHOD.

 

How can I do to solve this issue.

 

Accepted Solutions (1)

Accepted Solutions (1)

Neil_Lee_057
Explorer
0 Likes

After upload the certificate of API to "Maintain Certificate Trust List" APP,

I can call API success without exception.

Answers (0)