Home >Backend Development >PHP Tutorial >Why am I getting an SSLRead() Error with Curl POST Requests on OSX 10.10 and How Can I Fix It?

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

Linda Hamilton
Linda HamiltonOriginal
2024-11-02 23:16:30578browse

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"

You may see the following result:

SSL Version => SecureTransport

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
  3. Install curl with OpenSSL:

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

    $ brew install --with-homebrew-curl --with-httpd24 php55
  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!

Statement:
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