Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created August 22, 2016 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasplevy/0a78d2a7c39600562ac934e5e41f6e1c to your computer and use it in GitHub Desktop.
Save thomasplevy/0a78d2a7c39600562ac934e5e41f6e1c to your computer and use it in GitHub Desktop.
<?php // do not copy this line to your functions.php
/**
* Force TLS 1.2 for WordPress HTTP requests
*
* BEWARE:
* If TLS 1.2 becomes compromised and a newer version is released or required you will need to update
* this snippet!
*
* This also may not work
*
* More info at https://lifterlms.com/docs/lifterlms-stripe-tls-1-2/
*/
function my_tls_fix( $version ) {
curl_setopt( $handle, CURLOPT_SSLVERSION, 6 );
}
add_filter( 'http_api_curl', 'my_tls_fix' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment