Home  >  Article  >  Backend Development  >  How to Fix \"SSLRead() return error -9806\" After Upgrading to OSX 10.10 Yosemite?

How to Fix \"SSLRead() return error -9806\" After Upgrading to OSX 10.10 Yosemite?

Susan Sarandon
Susan SarandonOriginal
2024-11-02 10:23:02402browse

How to Fix

Solved: Curl POST to HTTPS Url After Upgrading to OSX 10.10 Yosemite

If you've encountered the error "SSLRead() return error -9806" after upgrading to OSX 10.10 Yosemite, you're not alone. This issue arises when making Curl POST requests to SSL URLs.

The problem stems from the fact that php is currently being compiled with cURL versions that employ Apple's Secure Transport under Yosemite. However, many target URLs for these requests no longer support SSLv3, which has been disabled due to the POODLE vulnerability.

Solution

To resolve this issue, you'll need to install a php version that utilizes cURL with OpenSSL instead of Secure Transport. Here's a step-by-step guide:

  1. Check SSL Version: Run the command "$ php -i | grep "SSL Version"" to confirm that cURL is using SecureTransport.
  2. Install Homebrew: If you haven't already, install Homebrew to manage software packages. Update Homebrew and install the necessary 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 and Openssl: "brew install --with-homebrew-curl --with-httpd24 php55."
  5. Configure Apache or Nginx:

    • Apache: Add "LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so" to "/etc/apache2/httpd.conf" and restart Apache.
    • Nginx: Follow the caveat instructions for starting fpm.
  6. Install PHP Extensions: Install any necessary php extensions, such as "brew install php55-mcrypt."
  7. Re-check SSL Version: Run "$ php -i | grep "SSL Version"" again to ensure that OpenSSL is being used.

Now, the "SSLRead() return error -9806" should no longer appear when you attempt Curl POST requests to HTTPS URLs.

The above is the detailed content of How to Fix \"SSLRead() return error -9806\" After Upgrading to OSX 10.10 Yosemite?. 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