I tried to fix this problem by using permutations of old curl and openssl
versions, including yours (curl 7.21.6 and openssl 1.0.0e), but with no
success. It must be a problem with my system, the only thing is that when I
use curl from the command line it works as expected. I'm not sure what is
causing this bug.