Results 1 to 7 of 7

Thread: HTTPS client-side POST

  1. #1
    Join Date
    Dec 2009
    Posts
    202

    HTTPS client-side POST

    Hello,
    I need to connect to a server using https POST method. I do not know much about https and SSL. So, if someone could explain how it works and how to proceed, it would be great. I searched the internet, and I found nothing very conclusive. Any help will be appreciated. Thank you in advance
    Last edited by ISAIAH; 23-01-2010 at 10:31 AM.

  2. #2
    Join Date
    Dec 2009
    Posts
    178

    Re: HTTPS client-side POST

    Hello,
    Even I am trying to write such program, so if you can help me, it will be good. Here is my code.
    Code:
    		try
    		{
    		URL testurl = new URL("https: / / address");
    HttpURLConnection connec = (HttpURLConnection)testurl.openConnection();
    connec.setRequestMethod("POST");
    System.out.System.out.println("Initialization OK");
    connec.setDoOutput(true);
    OutputStream out = connec.getOutputStream();
    OutputStreamWriter wout = new OutputStreamWriter(out);
    wout.write("test");
     
     
    		}catch(IOException e)
    		{
    			System.err.System.out.println(e);
    		}

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: HTTPS client-side POST

    Hello,
    If you are going to connect to https server, it is not using the normal http that it will work. I do not know if there is a HttpsURLConnection method or not. But in the worst case, you create an SSL socket, and you simply send your order over since the http command is composed of text. I have no idea about the HTTPS. By the way, why are you trying to use the https when there is http, it is not that the http is not a secure connection, it is also secure protocol.

  4. #4
    Join Date
    Dec 2009
    Posts
    202

    Re: HTTPS client-side POST

    Hello,
    Thanks you for your suggestion, but the simple http get method does not work with the https, I have tried it. I think I am missing something from my code. Another problem with my code it that the input stream is not working for me. I am using an input stream to get the data from the https, but first of all the input stream is not correctly written in my code. Any idea about this.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: HTTPS client-side POST

    Hi,
    If you are going to connect to an HTTP's then I think you can use the normal methods. There are whole process of key exchange, verification certificate that you are I think missing in your code. When you try to connect with the HttpURLConnector https method, AC would like to send an encrypted message to an HTTP server classic. I hope you realize this working of the method that you are using in the code.

  6. #6
    Join Date
    Dec 2009
    Posts
    202

    Re: HTTPS client-side POST

    Hello,
    Yes thank you I know now, I just copy paste an incorrect version.
    I would like to know how it is to accept a certificate.
    I have two connection methods:
    1 - With httpsUrlConnection
    And
    2 - With SSLSocket
    Will these methods work correctly in my code, are there any other methods available other than these, if there are, then please reply with them. thanks in advance.

  7. #7
    Join Date
    Jan 2008
    Posts
    1,521

    Re: HTTPS client-side POST

    Hello,
    With SSLSocket, you must have a trust store, which it will rely to accept the certificate and normally it just happens. That is automatically takes place. That's the advantage of SSLSocket, it is totally transparent. for HttpsURLConnection method, I have no ideas, because I have not used it more in my coding / programming.

Similar Threads

  1. Replies: 3
    Last Post: 27-02-2011, 07:24 AM
  2. How to validate client side javascript for phone number
    By Joko in forum Software Development
    Replies: 3
    Last Post: 18-08-2009, 12:55 PM
  3. client side framework failed to load ASP.NET ajax
    By Matellis in forum Software Development
    Replies: 4
    Last Post: 07-02-2009, 06:26 PM
  4. Difference between Server-side and Client-side code?
    By Booth in forum Software Development
    Replies: 2
    Last Post: 08-01-2009, 03:21 PM
  5. Replies: 4
    Last Post: 26-08-2008, 09:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,567,848.18196 seconds with 17 queries