Why am I getting an SSLRead() Error with Curl POST Requests on OSX 10.10 and How Can I Fix It?

Linda Hamilton
Release: 2024-11-02 23:16:30
Original
524 people have browsed it

Why am I getting an SSLRead() Error with Curl POST Requests on OSX 10.10 and How Can I Fix It?

SSLRead() Error: Troubleshooting Curl POST Requests on OSX 10.10

Upgrading to OSX 10.10 Yosemite can lead to an SSLRead() error when attempting Curl POST requests to HTTPS URLs. This occurs due to cURL relying on Apple's Secure Transport, which may disable SSLv3 as a security measure.

Identifying the Issue

To confirm, execute the command:

$ php -i | grep "SSL Version"
Copy after login

You may see the following result:

SSL Version => SecureTransport
Copy after login

Resolving the Issue

To resolve this, install a version of PHP utilizing OpenSSL instead of SecureTransport.

Steps:

  1. Install Homebrew and update it.
  2. Add the required Homebrew taps:

    $ brew tap homebrew/dupes
    $ brew tap homebrew/versions
    $ brew tap homebrew/php
    Copy after login
  3. Install curl with OpenSSL:

    $ brew install --with-openssl curl
    Copy after login
  4. Install PHP using the newly installed curl:

    $ brew install --with-homebrew-curl --with-httpd24 php55
    Copy after login
  5. Append LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so to /etc/apache2/httpd.conf if using Apache.
  6. For Nginx, follow instructions to start FPM.
  7. Install required PHP extensions (e.g., brew install php55-mcrypt)
  8. Rerun the check ($ php -i | grep "SSL Version") to verify OpenSSL usage.

The SSLRead() error should now be resolved.

The above is the detailed content of Why am I getting an SSLRead() Error with Curl POST Requests on OSX 10.10 and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template