cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Raw communication over a SSL/TSL connection

From: Dobromir Velev <diadomraz_at_gmail.com>
Date: Thu, 21 Nov 2013 17:17:33 +0200

Hi,
I've never tried that with curl and it was much easier to do it using the
openssl libraries directly.

Anyway as far as I remember no data is returned from the push gateway and
the connection is closed so this is most likely the cause of the error.
 Did you check if there was data for reading on the socket?

Dobromir

On Tue, Nov 19, 2013 at 12:13 PM, Victor Dodon <dodonvictor_at_gmail.com>wrote:

> I am trying to talk to the Apple services in order to send push
> notifications for the iOS devices. From the Apple Developer Library:
>
> "Connection trust between a provider and APNs is also established through
> TLS peer-to-peer authentication. The procedure is similar to that described
> in “Service-to-Device Connection Trust.” The provider initiates a TLS
> connection, gets the server certificate from APNs, and validates that
> certificate. Then the provider sends its provider certificate to APNs,
> which validates it on its end. Once this procedure is complete, a secure
> TLS connection has been established; APNs is now satisfied that the
> connection has been made by a legitimate provider."
>
> So the application must create a SSL connection to the apple push services
> and the communicate using a binary protocol.
>
> From the curl library I use curl_easy_{send,recv} only after setting
> CURLSETOPT_CONNECT_ONLY and performing a curl_easy_perform and after the
> socket becomes available for writing.
>
> Even if I don't set the certificate for the handle it always sends all the
> data using the curl_easy_send but when I try to recv I always receive
> unsupported protocol.
>
> I something that I miss, is the any example of a binary communication over
> a SSL connection?
>
> Here is the code: http://pastebin.com/eQnv07XU
>
> Thank you very much,
> Victor.
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-- 
Dobromir Velev
---------------------------------------------------------------------------
"Never attribute to malice that which can be
adequately explained by stupidity"

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-21