Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a cURL stream #3183

Merged
merged 10 commits into from Jun 24, 2015
Merged

Implement a cURL stream #3183

merged 10 commits into from Jun 24, 2015

Commits on Jun 24, 2015

  1. Copy the full SHA
    cf9d5f7 View commit details
    Browse the repository at this point in the history
  2. Implement a curl stream

    cURL has a mode in which it acts a lot like our streams, providing send
    and recv functions and taking care of the TLS and proxy setup for us.
    
    Implement a new stream which uses libcurl instead of raw sockets or the
    TLS libraries directly. This version does not support reporting
    certificates or proxies yet.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    8dea1c2 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    ede517b View commit details
    Browse the repository at this point in the history
  4. stream: add support for setting a proxy

    If the stream claims to support this feature, we can let the transport
    set the proxy.
    
    We also set HTTPPROXYTUNNEL option so curl can create a tunnel through
    the proxy which lets us create our own TLS session (if needed).
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    1376e78 View commit details
    Browse the repository at this point in the history
  5. http: set the proxy if the stream supports it

    Of the built-in ones, only cURL support it, but there's no reason a
    user-provided stream wouldn't support it.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    8762d72 View commit details
    Browse the repository at this point in the history
  6. curl: extract certificate information

    The information is exposed by curl for some crypto libraries in the form
    of name:content strings. We can't do much more than return this
    information.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    cdee630 View commit details
    Browse the repository at this point in the history
  7. openssl: use the curl stream if available

    When linking against libcurl, use it as the underlying transport instead
    of straight sockets. We can't quite just give over the file descriptor,
    as curl puts it into non-blocking mode, so we build a custom BIO so
    OpenSSL sends the data through our stream, be it the socket or curl
    streams.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    e247649 View commit details
    Browse the repository at this point in the history
  8. http: ask for the curl stream for non-encrypted connections

    The TLS streams talk over the curl stream themselves, so we don't need
    to ask for it explicitly. Do so in the case of the non-encrypted one so
    we can still make use proxies in that case.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    f97d5d0 View commit details
    Browse the repository at this point in the history
  9. curl: remove the encrypted param to the constructor

    We do not want libcurl to perform the TLS negotiation for us, so we
    don't need to pass this option.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    8443f49 View commit details
    Browse the repository at this point in the history
  10. SecureTransport: use the curl stream if available

    If the libcurl stream is available, use that as the underlying stream
    instead of the socket stream. This allows us to set a proxy for HTTPS
    connections.
    carlosmn committed Jun 24, 2015
    Copy the full SHA
    58ca8c7 View commit details
    Browse the repository at this point in the history