diff --git a/src/#apmg#cl_strust.clas.abap b/src/#apmg#cl_strust.clas.abap index dcad681..5b6e66d 100644 --- a/src/#apmg#cl_strust.clas.abap +++ b/src/#apmg#cl_strust.clas.abap @@ -13,7 +13,7 @@ CLASS /apmg/cl_strust DEFINITION ************************************************************************ PUBLIC SECTION. - CONSTANTS c_version TYPE string VALUE '2.1.1' ##NEEDED. + CONSTANTS c_version TYPE string VALUE '2.2.0' ##NEEDED. CONSTANTS: BEGIN OF c_context ##NEEDED, @@ -210,7 +210,7 @@ CLASS /apmg/cl_strust IMPLEMENTATION. " Remove Header and Footer TRY. - FIND REGEX '-{5}.{0,}BEGIN.{0,}-{5}(.*)-{5}.{0,}END.{0,}-{5}' IN certb64 SUBMATCHES DATA(base64). + FIND REGEX '-{5}.{0,}BEGIN.{0,}-{5}(.*)-{5}.{0,}END.{0,}-{5}' IN certb64 SUBMATCHES DATA(base64) ##REGEX_POSIX. IF sy-subrc = 0. ASSIGN base64 TO FIELD-SYMBOL(). ASSERT sy-subrc = 0. @@ -633,9 +633,9 @@ CLASS /apmg/cl_strust IMPLEMENTATION. IMPORTING license_number = license_num. - REPLACE '%SID' WITH sy-sysid INTO new_id. - REPLACE '%LIC' WITH license_num INTO new_id. - REPLACE '%ORG' WITH org INTO new_id. + REPLACE '%SID' IN new_id WITH sy-sysid. + REPLACE '%LIC' IN new_id WITH license_num. + REPLACE '%ORG' IN new_id WITH org. CONDENSE new_id. subject = new_id. diff --git a/src/#apmg#cl_strust_cert_api.clas.abap b/src/#apmg#cl_strust_cert_api.clas.abap index 226fab7..94d1c4a 100644 --- a/src/#apmg#cl_strust_cert_api.clas.abap +++ b/src/#apmg#cl_strust_cert_api.clas.abap @@ -20,13 +20,17 @@ CLASS /apmg/cl_strust_cert_api DEFINITION CLASS-METHODS get_certificates IMPORTING - !domain TYPE string - !ssl_id TYPE ssfapplssl DEFAULT 'ANONYM' - !debug TYPE abap_bool DEFAULT abap_false - !host TYPE string DEFAULT c_api_host - !endpoint TYPE string DEFAULT c_api_endpoint + !domain TYPE string + !ssl_id TYPE ssfapplssl DEFAULT 'ANONYM' + !debug TYPE abap_bool DEFAULT abap_false + !host TYPE string DEFAULT c_api_host + !endpoint TYPE string DEFAULT c_api_endpoint + !proxy_host TYPE string OPTIONAL + !proxy_service TYPE string OPTIONAL + !proxy_user TYPE string OPTIONAL + !proxy_passwd TYPE string OPTIONAL RETURNING - VALUE(result) TYPE string + VALUE(result) TYPE string RAISING /apmg/cx_error. @@ -38,6 +42,10 @@ CLASS /apmg/cl_strust_cert_api DEFINITION ssl_id TYPE ssfapplssl host TYPE string uri TYPE string + proxy_host TYPE string + proxy_service TYPE string + proxy_user TYPE string + proxy_passwd TYPE string RETURNING VALUE(result) TYPE REF TO if_http_client RAISING @@ -73,9 +81,13 @@ CLASS /apmg/cl_strust_cert_api IMPLEMENTATION. query = cl_abap_dyn_prg=>escape_xss_url( query ). DATA(http_client) = _client( - ssl_id = ssl_id - host = host - uri = |{ endpoint }?domain={ query }| ). + ssl_id = ssl_id + host = host + proxy_host = proxy_host + proxy_service = proxy_service + proxy_user = proxy_user + proxy_passwd = proxy_passwd + uri = |{ endpoint }?domain={ query }| ). DATA(fetch_response) = _response( http_client ). @@ -102,12 +114,16 @@ CLASS /apmg/cl_strust_cert_api IMPLEMENTATION. cl_http_client=>create_by_url( EXPORTING - url = host - ssl_id = ssl_id + url = host + ssl_id = ssl_id + proxy_host = proxy_host + proxy_service = proxy_service + proxy_user = proxy_user + proxy_passwd = proxy_passwd IMPORTING - client = result + client = result EXCEPTIONS - OTHERS = 99 ). + OTHERS = 99 ). IF sy-subrc <> 0. RAISE EXCEPTION TYPE /apmg/cx_error_t100. ENDIF. diff --git a/src/#apmg#strust_installer.prog.abap b/src/#apmg#strust_installer.prog.abap index 8c641ed..6eb160b 100644 --- a/src/#apmg#strust_installer.prog.abap +++ b/src/#apmg#strust_installer.prog.abap @@ -26,6 +26,14 @@ SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE TEXT-t04. p_endpnt TYPE string OBLIGATORY LOWER CASE. SELECTION-SCREEN END OF BLOCK b4. +SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE TEXT-t05. + PARAMETERS: + p_prhost TYPE string LOWER CASE, + p_prport TYPE string LOWER CASE, + p_pruser TYPE string LOWER CASE, + p_prpass TYPE string LOWER CASE. +SELECTION-SCREEN END OF BLOCK b5. + SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE TEXT-t03. PARAMETERS: p_passwd TYPE string LOWER CASE, @@ -81,10 +89,14 @@ START-OF-SELECTION. TRY. DATA(json) = /apmg/cl_strust_cert_api=>get_certificates( - ssl_id = p_ssl_id - domain = p_domain - host = p_host - endpoint = p_endpnt ). + ssl_id = p_ssl_id + domain = p_domain + host = p_host + endpoint = p_endpnt + proxy_host = p_prhost + proxy_service = p_prport + proxy_user = p_pruser + proxy_passwd = p_prpass ). TRY. DATA(ajson) = zcl_ajson=>parse( json ). diff --git a/src/#apmg#strust_installer.prog.xml b/src/#apmg#strust_installer.prog.xml index 2d0b404..0952869 100644 --- a/src/#apmg#strust_installer.prog.xml +++ b/src/#apmg#strust_installer.prog.xml @@ -34,6 +34,12 @@ API 80 + + I + T05 + Proxy + 80 + R Trust Management: Certificate Installer @@ -81,6 +87,30 @@ Password 16 + + S + P_PRHOST + Host + 18 + + + S + P_PRPASS + Password + 22 + + + S + P_PRPORT + Port + 18 + + + S + P_PRUSER + User + 18 + S P_ROOT diff --git a/src/#apmg#strust_updater.prog.abap b/src/#apmg#strust_updater.prog.abap index 36c47ae..a390d7c 100644 --- a/src/#apmg#strust_updater.prog.abap +++ b/src/#apmg#strust_updater.prog.abap @@ -26,6 +26,14 @@ SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE TEXT-t04. p_endpnt TYPE string OBLIGATORY LOWER CASE. SELECTION-SCREEN END OF BLOCK b4. +SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE TEXT-t05. + PARAMETERS: + p_prhost TYPE string LOWER CASE, + p_prport TYPE string LOWER CASE, + p_pruser TYPE string LOWER CASE, + p_prpass TYPE string LOWER CASE. +SELECTION-SCREEN END OF BLOCK b5. + SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE TEXT-t03. PARAMETERS: p_days TYPE i DEFAULT 30, @@ -118,7 +126,7 @@ START-OF-SELECTION. IF domain NA '.'. " It's probably a root or intermediate certificate - " Go to their website to + " -> Go to their website to download and install the certificate manually WRITE /5 'Unable to determine domain of certificate' COLOR COL_TOTAL. ULINE. CONTINUE. @@ -129,10 +137,14 @@ START-OF-SELECTION. TRY. DATA(json) = /apmg/cl_strust_cert_api=>get_certificates( - ssl_id = p_ssl_id - domain = domain - host = p_host - endpoint = p_endpnt ). + ssl_id = p_ssl_id + domain = domain + host = p_host + endpoint = p_endpnt + proxy_host = p_prhost + proxy_service = p_prport + proxy_user = p_pruser + proxy_passwd = p_prpass ). TRY. DATA(ajson) = zcl_ajson=>parse( json ). diff --git a/src/#apmg#strust_updater.prog.xml b/src/#apmg#strust_updater.prog.xml index ed4cc69..df2b2d4 100644 --- a/src/#apmg#strust_updater.prog.xml +++ b/src/#apmg#strust_updater.prog.xml @@ -34,6 +34,12 @@ API 80 + + I + T05 + Proxy + 80 + R Trust Management: Certificate Updater @@ -81,6 +87,30 @@ Password 16 + + S + P_PRHOST + Host + 12 + + + S + P_PRPASS + Password + 16 + + + S + P_PRPORT + Port + 12 + + + S + P_PRUSER + User + 12 + S P_REMOVE