• 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
Re: CFNetwork with multiple persistent HTTP connections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFNetwork with multiple persistent HTTP connections


  • Subject: Re: CFNetwork with multiple persistent HTTP connections
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 16 Jul 2009 08:04:39 -0700


On Jul 16, 2009, at 6:26 AM, Joe Ranieri wrote:

What I'm aiming for is having several persistent connections to a given HTTPS server, and just have requests queue up if all connections are processing requests. What's the best way to do this with CFNetwork?

Well, you can create multiple CFStreams, and for each one keep track of whether you've received a response to every request you've sent over it. This won't allow the streams to do any HTTP pipelining, but I don't believe CFNetwork supports that anyway.


Also, I need to do custom SSL certificate verification - where is the best place to do this? I tried doing it in kCFStreamEventOpenCompleted, but the stream (created via CFReadStreamCreateForHTTPRequest) never calls back for that event...

IIRC, there isn't a CFNetwork callback that lets you inspect the cert before the connection opens. If you want that level of control, you'd have to roll your own SSL support using the lower-level SecureTransport API.


What you could do is wait till after the SSL handshake, and then look at the cert and immediately close the connection if you don't like it. You can do this the first time the CFStream notifies you that there are bytes available to read. (The open-completed callback occurs before the SSL handshake, and in the case of an HTTP stream you don't get it at all.)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CFNetwork with multiple persistent HTTP connections
      • From: Joe Ranieri <email@hidden>
References: 
 >CFNetwork with multiple persistent HTTP connections (From: Joe Ranieri <email@hidden>)

  • Prev by Date: Re: how to use the same udp port already loaded by launchd?
  • Next by Date: Re: CFNetwork with multiple persistent HTTP connections
  • Previous by thread: CFNetwork with multiple persistent HTTP connections
  • Next by thread: Re: CFNetwork with multiple persistent HTTP connections
  • Index(es):
    • Date
    • Thread