bugGNUstep - Bugs: bug #34482, -[NSURLConnection...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #34482: -[NSURLConnection sendSynchronousRequest:returningResponse:error:] doesn't set response

Submitted by:  julian <julian_>
Submitted on:  Wed 05 Oct 2011 01:26:23 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: In Test

Fri 07 Oct 2011 05:14:42 PM UTC, comment #4:

>which seems to be a C API rather than ObjC


and an ugly one at that. using the "keychain" is pain.

julian <julian_>
Fri 07 Oct 2011 04:31:59 PM UTC, comment #3:

Thanks ... I see all the certificate stuff is new in OSX10.6 which will be why I handn't seen it. Looks good except for the dependency on the Security framework which seems to be a C API rather than ObjC :-(

Richard Frith-Macdonald <CaS>
Project Member
Fri 07 Oct 2011 04:20:05 PM UTC, comment #2:

thanks very much.

i guess NSURLConnection supports everything one could ask for (possible except a good way to globally change the User-Agent header for all HTTP requests):

http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html

julian <julian_>
Fri 07 Oct 2011 02:27:50 PM UTC, comment #1:

Thanks ... this should now be fixed in svn trunk.

Incidentally, I always use NSURLHandle because we added extensions to this to support https with client certificates used for authentication. I've never been inclined to migrate to the newer NSConnection API due to lack of support for that sort of thing.

Is there an official Apple API for managing SSL and certificate based authentication on an NSConnection? Does it support it at all? If there is a good API, I might write an implementation for GNUstep.

Richard Frith-Macdonald <CaS>
Project Member
Wed 05 Oct 2011 01:26:23 PM UTC, original submission:

-[NSURLConnection sendSynchronousRequest:returningResponse:error:] doesn't set any response, it is nil even if the call succeeds, so i have to use this code (inline may eat some obvious asterisks):

NSError *_error = nil;
NSHTTPURLResponse *response = NULL;
NSData *_data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&_error];

if (_data
#ifndef GNUSTEP
&& response && ([response statusCode] == 200)
#endif
&& (_error == nil))
{
// handle success
}
else
{
// handle failure
}

julian <julian_>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by julian_ (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 07 Oct 2011 02:27:50 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1