Re: how to add ssl support in my cocoa application
Re: how to add ssl support in my cocoa application
- Subject: Re: how to add ssl support in my cocoa application
- From: "Clint Shryock" <email@hidden>
- Date: Wed, 21 Feb 2007 09:05:24 -0600
Deusty Designs <http://deusty.blogspot.com/> recently wrote about using
OpenSSL with the SSCrypto
<http://septicus.com/products/opensource/>framework by Septicus
Software, <http://septicus.com/> which is available under a BSD style
license.
check out this post : http://deusty.blogspot.com/search/label/OpenSSL
hope that helps
+cts
On 2/21/07, aashish tiwari <email@hidden> wrote:
Hi list,
I have following method that handles "http://"
requests very well
+ (int) processHTTPRequest:(NSString *) request
withBody: (NSString *) body withResponse:
(NSMutableString *) httpResponse type: (NSString *)
requestType
{
/* Convert the request string to UTF8. */
const char *requestString;
requestString = [request UTF8String]; // request
contains URL of server
/* Convert the body string to UTF8. */
const char *bodyString;
bodyString = [body UTF8String];
/* Create a request */
CFStringRef cfStrRif =
CFStringCreateWithCString(kCFAllocatorDefault,
requestString, kCFStringEncodingUTF8);
CFURLRef cfUrl =
CFURLCreateWithString(kCFAllocatorDefault,cfStrRif,
NULL);
CFHTTPMessageRef httpRequest =
CFHTTPMessageCreateRequest(kCFAllocatorDefault,
(CFStringRef) requestType, cfUrl, kCFHTTPVersion1_1);
CFHTTPMessageSetHeaderFieldValue(httpRequest,
CFSTR("Content-Type"), CFSTR("multipart/form-data;
boundary=Mac08522OU8FPW9IY36"));
CFHTTPMessageSetHeaderFieldValue(httpRequest,
CFSTR("User-Agent"), CFSTR("MC"));
/* CFDataRef does not allocates a new memory area it
works on the buffer allocated */
CFDataRef refData;
/* Attach body to the httpRequest if its a post
request */
if ([requestType isEqualToString:@"POST"])
{
refData = CFDataCreate(kCFAllocatorDefault, (UInt8
*)bodyString, strlen(bodyString));
CFHTTPMessageSetBody(httpRequest,refData);
}
/*
* Open a CF read stream. This establishes the socket
connection and sends the http request,
* and gets the response.
*/
CFReadStreamRef httpReadStream =
CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault,
httpRequest);
/* Now set the proxy for the Stream */
CFDictionaryRef proxyDictionary;
proxyDictionary = [MYServer getProxySettings];
CFReadStreamSetProperty(httpReadStream,
kCFStreamPropertyHTTPProxy, proxyDictionary);
CFReadStreamOpen(httpReadStream);
.....
.......
........
}
Now i need to handle "https://" also....what changes i
need to do in my code so that i can establish SSL
connection with my server.
Please suggest me some tutorial or sample code
available, i dont want much code change...for example
i will prefer to continue using CF functions to
implement SSL support.
Please help me...
Thanks,
Aashish
___________________________________________________________
What kind of emailer are you? Find out today - get a free analysis of your
email personality. Take the quiz at the Yahoo! Mail Championship.
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden