• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURLConnection & ignoring untrusted server certificates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection & ignoring untrusted server certificates


  • Subject: NSURLConnection & ignoring untrusted server certificates
  • From: Erg Consultant <email@hidden>
  • Date: Wed, 28 Jan 2009 22:41:20 -0800 (PST)

When I try to connect to my web server using NSURLConneciton thusly:

loadedData = [ NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error ];

The data comes back with a zero length. Inspecting the error reveals that it's an untrusted server certificate error. Is there any way to ignore certificates in my request, or to tell NSURLConnection to ignore/not use them or to get the data anyway? I don't really care about security in this instance - I just need the returned data. I verified that my URL is correct by typing it into Safari. My error object:

<CFDictionary 0x16b250f0 [0xa05001a0]>{type = immutable, count = 6, capacity = 6, pairs = (
    0 : <CFString 0xa05dcd68 [0xa05001a0]>{contents = "NSErrorPeerCertificateChainKey"} = <CFArray 0x16b39e30 [0xa05001a0]>{type = mutable-small, count = 3, values = (
    0 : <SecCertificate 0x16b287f0 [0xa05001a0]>
    1 : <SecCertificate 0x16b46c30 [0xa05001a0]>
    2 : <SecCertificate 0x16b1f5b0 [0xa05001a0]>
)}
    1 : <CFString 0xa05d5ed8 [0xa05001a0]>{contents = "NSUnderlyingError"} = Error Domain=kCFErrorDomainCFNetwork Code=-1202 UserInfo=0x4efbf0 "untrusted server certificate"
    3 : <CFString 0xa05dcd58 [0xa05001a0]>{contents = "NSErrorFailingURLKey"} = <CFURL 0x4b7830 [0xa05001a0]>{type = 15, string = http://staging.iwin.com/drm?sid=1737980694905205001&hid=2A6A41FD0095959FF595959FF22A6A41FD05&lid=13&email=email@hidden&act=2&aid=0&pid=0, base = (null)}
    4 : <CFString 0xa05d5fb8 [0xa05001a0]>{contents = "NSErrorFailingURLStringKey"} = <CFString 0x4efee0 [0xa05001a0]>{contents = "http://staging.iwin.com/drm?sid=1737980694905205001&hid=2A6A41FD0095959FF595959FF22A6A41FD05&lid=13&email=email@hidden&act=2&aid=0&pid=0"}
    6 : <CFString 0xa05d5ec8 [0xa05001a0]>{contents = "NSLocalizedDescription"} = <CFString 0x3815a60 [0xa05001a0]>{contents = "untrusted server certificate"}
    7 : <CFString 0xa05dcd88 [0xa05001a0]>{contents = "NSErrorClientCertificateStateKey"} = <CFNumber 0x410cc0 [0xa05001a0]>{value = +0, type = kCFNumberSInt32Type}
)}




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: NSURLConnection & ignoring untrusted server certificates
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: change NSBorderlessWindowMask on NSTitledWindowMask when app is launch. how?
  • Next by Date: Re: NSLevelIndicator Rating with "half" stars
  • Previous by thread: Re: change NSBorderlessWindowMask on NSTitledWindowMask when app is launch. how?
  • Next by thread: Re: NSURLConnection & ignoring untrusted server certificates
  • Index(es):
    • Date
    • Thread