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

Group
 
 

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

Submitter:  julian <julian_>
Submitted:  Wed 05 Oct 2011 01:26:23 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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_>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-07 CaS StatusNone Fixed
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code