Skip to content

Instantly share code, notes, and snippets.

@kosikond
Forked from franz-josef-kaiser/http_ssl_fix.php
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save kosikond/08178655939bfa9d7063 to your computer and use it in GitHub Desktop.

Select an option

Save kosikond/08178655939bfa9d7063 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Fix SSL Versions & Cloudflare ECDSA
* Description: Remove SSL v1-3 from cURL Requests. PHP v5.5.19+/5.6.3+ only
* Author: Ondra Kosik <ondra@kosik.co.uk>
* Author URl: http://kosik.co.uk
* License: MIT
*/
add_action( 'http_api_curl', function( $args )
{
curl_setopt(
$args[0],
CURLOPT_SSLVERSION,
CURL_SSLVERSION_TLSv1_2
| CURL_SSLVERSION_TLSv1_1
| CURL_SSLVERSION_TLSv1_0
);
curl_setopt($args[O], CURLOPT_SSL_CIPHER_LIST, 'ecdhe_ecdsa_aes_128_sha');
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment