Skip to content

SSL and the threaded runtime #3

@iustin

Description

@iustin

Hi,

It turns out that the curl bindings are not doing the right thing w.r.t. threaded use of the library. I reported this on haskell cafe a bit earlier, and in the meantime I have found out some more details on this.

The (C) curl library is special: while it uses one of OpenSSL, GCrypt or NSS (not sure about the last one), it doesn't set up the actual SSL library for threaded usage. Which means that for single-threaded uses, it's perfectly safe, however when switching to a threaded model, random segfaults/aborts start to crop up.

Looking at other bindings for curl, e.g. the Python pycurl bindings, it looks like explicit SSL handling is needed in case of threading.

So an option would be to do that in curl (haskell) bindings itself; the alternative, doing it in a separate mini-library that is explicitly linked in by the user would be tricky, as only curl headers define exactly what SSL backend it uses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions