How to make an HTTP request via SSL

Hi,
I´m using an instance of the class CL_HTTP_CLIENT to make an HTTP request to a https server. as long as it requires an SSL authentication, it returns an ICM_HTTP_SSL_ERROR error message.
How do I tell my program to ask for user´s certificate, and use it in the http request?
I´m supossed to have hundreds of users online running this application (it´s over SRM 5.0). How can I reach this?
Thanks you very much.
Federico.

Hello Frederico,
>1. By creating a new client, you mean go to "Environment->SSL Client Identitites" in STRUST, right? >Can I use a previously existing one?
I meant to create a new client SSL PSE. By default in a new Netweaver abap system, you have 3 of them : ANONYM, DFAULT and WSSE.
If you need more of them, you can create them with the menu "Go to-->Environment->SSL Client Identitites".
>2. I need this PSE client to have several 'identitites', I mean, to include several certificates from all my >users. Is it possible? If it´s not; how should I do so?
It seems that you want a different certificate per user. These client certificates in STRUST are designes to identify a SAP abap system, not human users. If you have 1000 users, you will not create 1000 certificates in STRUST !
Usually, you use only 2 entries here, one for anonymous HTTPS access and one authenticated HTTPS access. It is unusual to have several different identities for the same abap server. But  it might be possible : for exemple, one identity on the intranet and an other one on the Internet.
>3. When I had my new PSE client, and my HTTP RFC destination of type 'G' configured to use that >PSE client, and when in abap I instantiate my http client (using CREATE_BY_DESTINATION method, >from CL_HTTP_CLIENT class): How does SAP knows which certificate to use? Because there will be >several users (hundreds) running this code to retrieve their specific data from a third party server.
>How does SAP knows whom certificate must use?
The certificate used will be the one defined in the HTTP destination.
You still seem to make the confusion between server client certificates and users  client certificates.
a users client certificate is stored in the user's PC (or smartcard) and is used for HTTPS connections from the user's browser to the SSL server, not for an HTTPS connection from the ABAP server to another server.
Regards,
Olivier

Similar Messages

  • How to make a http request from a pl/sql procedure(URGENT)

    I need to make a http request from a pl/sql procedure, can any one tell me which built-in package and which procedure/function we serve my need?
    Thanks in advance.
    Ram Prasad.

    You should use UTL_HTTP package, but before it install the JVM into DB

  • How to send a https request using jsf

    hi
    Can anybody tell a sample how to send a https request using JSF ...
    thanks

    Prefix the request URI with the https protocol.
    The answer is too easy and straightforward that I guess that you mean something else. If you just want to know how to configure an SSL environment for your own webapplication, refer to the Java EE tutorial chapter 28: http://java.sun.com/javaee/5/docs/tutorial/doc/

  • After Mavericks OS upgrade, can no longer make any HTTP requests with the OPTIONS verb

    My machine can no longer make any HTTP requests with the OPTIONS verb. This happens whether I try it curl, postman, or ajax.
    curl -i -X OPTIONS http://www.google.com returns curl: (52) Empty reply from server
    It should return a long string containing a 405 error code.
    I suspect that this is related to the Mavericks upgrade I did earlier this week. I only have one mac (my dev machine) with Mavericks. Other macs are Mountain Lion and they don't have this problem.
    Can anyone else with Mavericks confirm whether or not they have this problem too?
    If this is Mavericks related, anyone know of a fix or workaround?

    Turns out that it wasn't Mavericks related at all. Cisco AnyConnect has a security module running behind the scenes even when you're not VPNed into anything. It was blocking my OPTIONS verb requests. I was able to make these calls after uninstalling.
    Re-installing with Web Security turned off should prevent it from happening. While I was uninstalling I did notice that there was a web security uninstall script in /opt/cisco/vpn/bin but I already committed to taking the whole app off my machine. Simply running that script could have done it too.
    I must give credit to Ben Nadel. It was his blog post that helped me fix this issue.
    http://www.bennadel.com/blog/2559-Cisco-AnyConnect-VPN-Client-May-Block-CORS-AJA X-OPTIONS-Requests.htm?&_=0.10495476494543254#comments_44093

  • How to transfer the http request from applet to servlet/jsp

    I use the JTree component to create a navigation of a website,but i don't
    know how to connect the tree's nodes with the jsp/servlet.
    I mean how to transfer the http request from the applet to a jsp.
    I use the "<frameset>" mark which will divide the web browse into 2 blocks.
    The left side is Applet,and the right side is the linked jsp page.
    what I say is as the weblogic console layout.
    who can help me!!!
    Thank You!

    I use the JTree component to create a navigation of a website,but i don't
    know how to connect the tree's nodes with the jsp/servlet.
    I mean how to transfer the http request from the applet to a jsp.
    I use the "<frameset>" mark which will divide the web browse into 2 blocks.
    The left side is Applet,and the right side is the linked jsp page.
    what I say is as the weblogic console layout.
    who can help me!!!
    Thank You!

  • How to make Oracle HTTP server a proxy server...

    I need a proxy server for Google Mini search Appliance. I have Oracle 9iAS on AIX 5.2; can someone tell me how to make Oracle HTTP server function as Proxy server?
    Thanks,
    Jess

    Maybe check the below link:-
    http://httpd.apache.org/docs/1.3/mod/mod_proxy.html

  • How to submit a HTTP Request from a Java Program

    I am working on an web based application where in I need to submit the HttpRequest through a Java Program and not through browser. Moreover my intent is just to submit the HttpRequest. I donot want to wait for the response to come back. I have used the URL Connection class to do the same and I am trying to post this request. The contents of the methods that I am using are as below:-
    public void doPost(URL url, String inputXMLString) throws IOException
              //Create URLConnection based on the passed URL
              URLConnection connection = url.openConnection();
              connection.setDoOutput(true);
              connection.setDoInput(false);
              connection.setUseCaches(false);
              connection.setAllowUserInteraction(false);
              connection.setRequestProperty("Content-type", "application/x-www-form-
    urlencoded");
              //Get the Connection's output stream and write the request to it.
              PrintWriter out = new PrintWriter(connection.getOutputStream());
              out.print("&ena-request-input=" + URLEncoder.encode(inputXMLString));
              out.flush();
              out.close();
    Call to the above method does not invoke the URL I am intending to submit the request at.
    Can anybody give me the clue....................................................?

    I agree with the advice to launch a new thread to read and ignore the response. I don't think you should have to do it to make it work, but it's worth trying for two reasons:
    1) If it turns out it does make it work, well, then either you can leave it that way, or use that as a clue to help figure out how to make it work the way you want.
    2) There may be an error message there that will give you an idea why it's not working.
    When you say it's not invoking the servlet, what does that mean, and how do you know? Is it just that the final results aren't being seen? Put a bunch of logging statements in the servlet. It could be that it's getting hit, but you're corrupting the string you're building, or sending some extra junk that it can't handle. Spit out a log statement from the start of doPost, to see if it's even getting there. Then log the parameter. Enclose the output in quotes or braces or something to make sure there's not extra junk. I've had XML docs not parse because there was a blank line at the beginning.
    If it works in the browser but not from your standalone app, then you need to have the servlet tell what difference it sees in the two cases. Print out headers, other params, everything you can think of.
    Re-read the docs for URL, HttpURL, whatever, to make sure you're doing all the right steps in the right order. Make a servlet that just takes a single, simple param=value via POST and see if you can get that to work.

  • How to make a multiple request without waiting for a response in java ?

    A more specific question:
    how to make a multiple HTTP request without waiting for a HTTP response in java (using httpURLConnection)?
    Thanks

    Thanks for responding.
    But i want to make further request to the same resource URL. I want to reuse the connection, don't want to create a new connection for each of individual request.
    How can i do that using HttpURLConnection ?
    Thanks.

  • How to pass a HTTP request from a simple java class

    Is it possible to pass an HTTP request from a simple java class.if yes how?

    Is it possible to pass an HTTP request from a simple
    java class.if yes how?If you're talking about creating a HttpRequest object and passing it to a servlet, that would be a red flag to me that your design is flawed. You shouldn't have to do that - the application server (Tomcat, Weblogic, etc) should be the only thing that has to worry about creating that kind of object and passing it to you.

  • How to send a http request to a non java appln

    I have one legacy web application running which can handle only http request . So I need to connect (using http request) and send my request and get the response, without opening that application in browser.
    Any idea
    1) How to connect to non - java appln from a java appln ?
    2) How to use the Httprequest without displaying the page using browser?

    You can try one of three routes:
    Open a socket and write the HTTP request and parse the HTTP response yourself
    Use java.net.URLConnection
    Use Jakarta Common's HttpClient at jakarta.apache.org- Saish

  • How to make local Object Request as Transportable Request

    Hi,
    I have saved as local Object , Now i need to make has transportable request.
    Can any body tell how to do?
    Regds,
    C.V.
    Message was edited by:
            P.C.V.

    Hi Chakri,
    Drag and drop that object into right screen of Transport connector tool and then click on Click on Truck button to create the Transport request.
    With rgds,
    Anil Kumar Sharma .P

  • How to send a http-request from abap?

    I want to send a xml file through a http-request ,what should i do?

    Welcome to SDN
    you can use cl_http_client class to do that. search the abap general forum with key word cl_http_client and you will find lot of examples.
    Regards
    Raja

  • How to post multiple http requests using a single http connection in java

    I am using the httpurlconnection class and it allows only to post one request on a connection. I require to post multiple http requests by opening a single connection. Code examples please. Thanx in advance.

    Hi
    I found this article through Google. I hope it helps a little
    http://www.developer.com/tech/article.php/761521
    D

  • How to send a HTTP request to servlet in java application

    I'm new in Java. I need to send a HTTP request with parameters to servlet in a java aplication. Here is my code. It can be compiled but always threw an exceptions when I ran it. Can anyone help?
    package coreservlets;
    import java.io.*;
    import java.net.*;
    public class PostHTTP
         public static void main(String args[])
              throws IOException, UnknownHostException {
              try
              // URL and servlet
                   URL myURL = new URL("http://pc076/servlet/coreservlets.OffHold");
                   URLConnection c = myURL.openConnection();
                   c.setUseCaches(false);
                   c.setDoOutput(true);
                   ByteArrayOutputStream byteStream = new ByteArrayOutputStream(512);
                   PrintWriter out = new PrintWriter(byteStream, true);
    //parameters
                   String postData = "REASON_CODE=3B&RSPCODE=JSmith&CASENUM=NA795401&REPLY=123&SOURCE=XYZ&REPLYLINK=http://pc076/servlet/coreservlets.ShowParameters";
                   out.print(postData);
                   out.flush();
                   String lengthString = String.valueOf(byteStream.size());
                   c.setRequestProperty("Content-Length", lengthString);
                   c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                   byteStream.writeTo(c.getOutputStream());
                   BufferedReader in =     new BufferedReader(new InputStreamReader
                                                 (c.getInputStream()));
                   String line;
                   //String linefeed = "\n";
                   //resultsArea.setText("");
                   while((line = in.readLine()) != null) {
                        System.out.println(line);
                        //resultsArea.append(linefeed);
              catch(IOException ioe) {
              // Print debug info in Java Console
              System.out.println("IOException: " + ioe);

    here are some updates to your code I haven't tested it running
    post again if you still have trouble
    URL myURL = new URL("http://pc076/servlet/coreservlets.OffHold");
    HttpURLConnection c = (HttpURLConnection)myURL.openConnection();
    c.setDoInput(true);
    c.setDoOutput(true);
    ByteArrayOutputStream byteStream = new ByteArrayOutputStream(512);
    String lengthString = String.valueOf(byteStream.size());
    c.setRequestProperty("Content-Length", lengthString);
    c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    PrintWriter out = new PrintWriter(byteStream, true);
    //parameters
    String postData = "REASON_CODE=3B&RSPCODE=JSmith&CASENUM=NA795401&REPLY=123&SOURCE=XYZ&REPLYLINK=http://pc076/servlet/coreservlets.ShowParameters";
    out.print(postData);
    out.flush();
    byteStream.writeTo(c.getOutputStream());
    // connect
    c.connect();
    BufferedReader in = new BufferedReader(new InputStreamReader
    (c.getInputStream()));
    String line;
    while((line = in.readLine()) != null)
        System.out.println(line);

  • How to make a HTTP Post request to a remote server ?

    Hi Guys,
    I'm new to java technology. I've a small problem with my code. All i need is to send a request to the remote server whose control is not at all in my hands with the POST method, which includes few of the parameters along with one of them is a xml formatted variable. The result of this request is an xml generated out which i want to fetch in my jsp code. I've tried it with the HTTPUrlConnection method and code for the same is below :
    <%
    try {
    String xmlString = "<FARES><AGENCY_ID>TFI</AGENCY_ID><DEP_CITY>NYC</DEP_CITY><ARR_CITY>LON</ARR_CITY><DEP_DATE>12</DEP_DATE><DEP_MONTH>DEC</DEP_MONTH><OWRT>RT</OWRT></FARES>";
    URL url = new URL("http://www.lowestairprice.com/Canada/mars.asp?WCI=Start&WCE=XMLFARES&reqMsg=Yes&");
    HttpURLConnection con = (HttpURLConnection)url.openConnection();
    con.setInstanceFollowRedirects(true);
    con.setFollowRedirects(true);
    con.setRequestMethod("POST");
    con.setDoOutput(true);
    out.println("Testing...");
    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(con.getOutputStream()));
    bw.write("xmltekst=" + xmlString);
    bw.flush();
    bw.close();
    BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line = br.readLine();
    String result ="";
    while (line !=null) {
    result += line;
    line = br.readLine();
    br.close();
    out.println("Resultat: " + result);
    } catch(Exception exc) {
    exc.printStackTrace();
    out.println(exc);
    %>
    But when i run this on browser it gives me the following error.
    java.net.MalformedURLException: unknown protocol: https
    Now the response they provide is thrown back with the https protocol instead of the http. How can i fetch their response in my jsp code and store it in a local variable.
    If anybody can help me out in this, i would be thankful for the same.
    Thanking You,
    Rgds,
    Gaurav
    (Software Engineer)
    Ultra Infotech.

    Have you tried to use HttpsURLConnection instead ?

Maybe you are looking for

  • ITunes 10.5 will not install on Windows XP

    I'm trying to install 10.5 iTunes on my Windows XP computer, but it keeps giving the following message: " There is a problem with this Windows installer package. A program required for this install to complete could not be run. Contact your support p

  • Thumbnails for AVI?

    I get a thumbnail for WMV video files but not for AVI video file using Bridge V2.1.1.9. I do get an AVI thumbnail if I open the file in windows explorer so the computer knows how to do it. Is this a file association thing? It is set to none right now

  • Another day, another Go Client - RubyGo

    Encouraged by my success with building, installing & packaging the glGo program earlier* last week, I wanted to try to build a pkgbuild myself to see if I can.  However I have run into a few snags & I could use the experience of those more knowledgea

  • How do I delete content from a drop zone without deleting the drop zone?

    I can't seem to figure this out, and I feel silly about it!  Your help is much appreciated

  • Whats the solution for this technical default

    Hi, I am sorry to post this here but still want to know why?:-).... For any functional module there is import export parameters.We can understand easily what we need to pass what we get But in tables Tab(in function module only)...there is no clarity