Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Authentication type for cl_http_client=>create_by_url

Former Member
0 Likes
4,669

Hi All,

I am trying to understand how to set authentication type

for "cl_http_client=>create_by_url".

It is currently defaulting to client certificate.

ICM log: "auth_type=3 (USE_CLIENT_CERT)) "

I need to set to no authentication as server requires password/user as url parms.

If I use an RFC dest I can set to "No logon" but then I cannot append user/pass to the url.

Any help appeciated

Thanks in advance

Allan

1 ACCEPTED SOLUTION
Read only

Former Member
2,128

Try setting the background user...and providing the username and password there itself

Try setting the background user...and providing the username and password there itself

5 REPLIES 5
Read only

Former Member
2,129

Try setting the background user...and providing the username and password there itself

Read only

0 Likes
2,128

you can just use the following code sample.

concatenate
'http://<siteaddress>/<loginpage>?<useridparameternameincalledsystem>='
'useridtobepassedtocalledsystem' '&<passwordfilenameincalledsystem>=<password>' into wf_String .

call method cl_http_client=>create_by_url
    exporting
      url                = wf_string
    importing
      client             = http_client
    exceptions
      argument_not_found = 1
      plugin_not_active  = 2
      internal_error     = 3
      others             = 4.

where did you find that its using SSL?

in case if the called url required ssl certificate, then you can to download the certificate from that system and load it in ABAP system and use the sslid to pass it to create_by_url method.

Regards

Raja

Read only

Former Member
0 Likes
2,128

Hi All,

Looks like I was a bit confused about what was actually happening.

After further testing, it seems that if I call

cl_http_client=>create_by_destination (via rfc connection)

then the certificate is used.

But if I call

cl_http_client=>create_by_url( EXPORTING url = url

then it can't seem to find the certificate.

I have setup the certs for both "SSL client standard" and

"SSL client anonymous".

I get the feeling I am missing something obvious

Read only

Former Member
0 Likes
2,128

thanks Raja,

I wasn't passing the SSL_ID, as it isn't required for

create_by_destination I assumed I wouldn't need to specify

that.

Read only

0 Likes
2,128

yes you are right, while using create_by_destination you dont need that as that would be sepecified in the RFC destination itself.

Regards

Raja