Created
February 17, 2020 09:47
-
-
Save vanbo/6cbc2c15c34b7f8803dd87bdeb117776 to your computer and use it in GitHub Desktop.
WC Paytrace - Force API to use TLS 1.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'http_api_curl', 'paytrace_http_api_curl', 10, 3 ); | |
| /** | |
| * Force posts to Paytrace to use TLS v1.2. | |
| * | |
| * @param string $handle | |
| * @param mixed $r | |
| * @param string $url | |
| */ | |
| function paytrace_http_api_curl( $handle, $r, $url ) { | |
| if ( strstr( $url, 'https://' ) && ( strstr( $url, 'api.paytrace.com' ) || strstr( $url, 'paytrace.com/api' ) ) ) { | |
| curl_setopt( $handle, CURLOPT_SSLVERSION, 6 ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment