Results 1 to 9 of 9
Thread: Usage of HTTPS
- 12-03-2008, 09:34 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 18
- Rep Power
- 0
- 12-03-2008, 10:33 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Did you tried anything yet? At least search on Google?
- 12-03-2008, 11:33 AM #3
Member
- Join Date
- Jan 2008
- Posts
- 18
- Rep Power
- 0
Yes i have done little bit search on Google it is telling about JSSE(Java Secure Socket Extensions) i just want the steps that i need to do so that i can send Https requets to server
- 12-03-2008, 01:09 PM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Do you want to workout on the server side or on the client side?
- 12-03-2008, 01:31 PM #5
Member
- Join Date
- Jan 2008
- Posts
- 18
- Rep Power
- 0
Could you please brief me basic steps that we have to fallow on both the side Server side as well as Client side
- 12-03-2008, 01:37 PM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
First of all you should learn about sockets. That's starting point you have to move ahead.
- 12-03-2008, 01:48 PM #7
Member
- Join Date
- Jan 2008
- Posts
- 18
- Rep Power
- 0
Right now i need some help to create SSL connection between client and server.
- 12-05-2008, 07:11 AM #8
Are you writing the client? or the server?
This is well documented. What have you done so far (if anything)?
What specific problems are you having?
This is not a forum for finding packaged answers. We will help, but not do your homework. You learn nothing from cheating.
- 12-06-2008, 10:02 AM #9
Member
- Join Date
- Dec 2008
- Posts
- 6
- Rep Power
- 0
Use apache httpclient APIs
Note: when uploading to https web server, the web server's "public key certificate" should be present in the client machine's JRE's keystore file.
normally present in <jdkhome>\jre\lib\security\cacerts
here cacerts file is the keystore file
you need to import the certificate into this keystore file using keytool command
sample code;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public class PostAFile {
private static String url =
"url to server, where you want to upload file";
public static void main(String[] args) throws IOException {
HttpClient client = new HttpClient();
PostMethod postMethod = new PostMethod(url);
client.setConnectionTimeout(8000);
// Send any XML file as the body of the POST request
File f = new File("students.xml");
System.out.println("File Length = " + f.length());
postMethod.setRequestBody(new FileInputStream(f));
postMethod.setRequestHeader("Content-type",
"text/xml; charset=ISO-8859-1");
int statusCode1 = client.executeMethod(postMethod);
System.out.println("statusLine>>>" + postMethod.getStatusLine());
postMethod.releaseConnection();
}
}
refer to: theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload
Similar Threads
-
https client
By karine in forum Advanced JavaReplies: 6Last Post: 10-31-2008, 12:41 PM -
HTTPS using certificate
By MCJP in forum Advanced JavaReplies: 1Last Post: 09-25-2008, 01:48 PM -
JVM memory usage
By lardum in forum New To JavaReplies: 7Last Post: 06-26-2008, 03:30 AM -
JDK 1.3 with HTTPS
By sriram in forum Advanced JavaReplies: 2Last Post: 01-21-2008, 10:51 PM -
HTTPS and JBoss
By Heather in forum Advanced JavaReplies: 2Last Post: 06-30-2007, 04:50 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks