Skip to content

Commit 3b6e380

Browse files
Add HTTP protocol as a new parameter to test SSL report (#222)
Co-authored-by: Marc Bernard <[email protected]>
1 parent 8b86de2 commit 3b6e380

File tree

1 file changed

+42
-9
lines changed

1 file changed

+42
-9
lines changed

Diff for: src/.vuepress/public/assets/src/zabapgit_test_ssl.abap

+42-9
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ SELECTION-SCREEN SKIP.
4040
SELECTION-SCREEN BEGIN OF BLOCK sc_serv WITH FRAME TITLE sc_titl2.
4141
PARAMETERS:
4242
p_url1 TYPE string LOWER CASE DEFAULT 'https://github.com' OBLIGATORY,
43-
p_url2 TYPE string LOWER CASE DEFAULT 'https://api.github.com',
44-
p_id TYPE strustssl-applic DEFAULT 'ANONYM' OBLIGATORY.
4543
* api.github.com is used when pushing code back to github
44+
p_url2 TYPE string LOWER CASE DEFAULT 'https://api.github.com',
45+
p_id TYPE strustssl-applic DEFAULT 'ANONYM' OBLIGATORY,
46+
p_http TYPE i DEFAULT if_http_request=>co_protocol_version_1_1 OBLIGATORY AS LISTBOX VISIBLE LENGTH 30.
4647
SELECTION-SCREEN END OF BLOCK sc_serv.
4748

4849
SELECTION-SCREEN SKIP.
@@ -70,6 +71,9 @@ CLASS lcl_report DEFINITION.
7071
RETURNING
7172
VALUE(rv_url) TYPE string.
7273

74+
75+
METHODS http_protocol_list_box.
76+
7377
PRIVATE SECTION.
7478

7579
TYPES:
@@ -111,12 +115,10 @@ CLASS lcl_report IMPLEMENTATION.
111115
METHOD run.
112116

113117
DATA:
114-
lv_code TYPE i,
115-
lv_url TYPE string,
116-
li_http_client TYPE REF TO if_http_client,
117-
lv_error_message TYPE string,
118-
lv_reason TYPE string,
119-
lv_response TYPE string.
118+
lv_code TYPE i,
119+
li_http_client TYPE REF TO if_http_client,
120+
lv_reason TYPE string,
121+
lv_response TYPE string.
120122

121123
IF iv_url IS INITIAL.
122124
RETURN.
@@ -148,6 +150,8 @@ CLASS lcl_report IMPLEMENTATION.
148150
password = p_ppwd ).
149151
ENDIF.
150152

153+
li_http_client->request->set_version( p_http ).
154+
151155
li_http_client->send( ).
152156

153157
li_http_client->receive(
@@ -159,7 +163,7 @@ CLASS lcl_report IMPLEMENTATION.
159163

160164
IF sy-subrc <> 0.
161165
display_error( 'HTTP Client Receive' ).
162-
166+
163167
li_http_client->get_last_error(
164168
IMPORTING
165169
message = lv_response ).
@@ -308,6 +312,32 @@ CLASS lcl_report IMPLEMENTATION.
308312

309313
ENDMETHOD.
310314

315+
316+
METHOD http_protocol_list_box.
317+
318+
DATA:
319+
lt_values TYPE vrm_values,
320+
ls_value LIKE LINE OF lt_values.
321+
322+
ls_value-key = if_http_request=>co_protocol_version_1_0.
323+
ls_value-text = 'HTTP/1.0'.
324+
APPEND ls_value TO lt_values.
325+
326+
ls_value-key = if_http_request=>co_protocol_version_1_1.
327+
ls_value-text = 'HTTP/1.1'.
328+
APPEND ls_value TO lt_values.
329+
330+
CALL FUNCTION 'VRM_SET_VALUES'
331+
EXPORTING
332+
id = 'P_HTTP'
333+
values = lt_values
334+
EXCEPTIONS
335+
id_illegavrm_id = 1
336+
OTHERS = 2.
337+
ASSERT sy-subrc = 0.
338+
339+
ENDMETHOD.
340+
311341
ENDCLASS.
312342

313343
DATA go_report TYPE REF TO lcl_report.
@@ -322,6 +352,7 @@ INITIALIZATION.
322352
%_p_url1_%_app_%-text = 'URL (Read Access)'.
323353
%_p_url2_%_app_%-text = 'URL (Write Access)'.
324354
%_p_id_%_app_%-text = 'SSL Client Identity'.
355+
%_p_http_%_app_%-text = 'HTTP protocol'.
325356
sc_titl3 = 'Proxy Settings (Optional)'.
326357
%_p_proxy_%_app_%-text = 'Hostname/IP'.
327358
%_p_pport_%_app_%-text = 'Port'.
@@ -345,6 +376,8 @@ AT SELECTION-SCREEN OUTPUT.
345376
ENDIF.
346377
ENDLOOP.
347378

379+
go_report->http_protocol_list_box( ).
380+
348381
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_url1.
349382
p_url1 = go_report->f4_url( ).
350383

0 commit comments

Comments
 (0)