[wp-trac] [WordPress Trac] #34924: Network upgrade fails on tls 1.2 only servers

WordPress Trac noreply at wordpress.org
Wed Jan 4 23:50:09 UTC 2017


#34924: Network upgrade fails on tls 1.2 only servers
--------------------------+------------------------------
 Reporter:  mensmaximus   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP API      |     Version:  2.7
 Severity:  normal        |  Resolution:
 Keywords:  https         |     Focuses:  multisite
--------------------------+------------------------------

Comment (by mnelson4):

 FYI this is what woocommerce is doing to resolve the issue until this
 happens in WP core:
 {{{#!php
 ...
                 add_action( 'http_api_curl', array( $this,
 'force_ssl_version' ) );
         }
         /**
          * Force SSL version to TLS1.2 when using cURL
          *
          * Thanks olivierbellone (Stripe Engineer)
          * @param resource $curl the handle
          * @return null
          */
         public function force_ssl_version( $curl ) {
                 if ( ! $curl ) {
                         return;
                 }
                 if ( OPENSSL_VERSION_NUMBER >= 0x1000100f ) {
                         if ( ! defined( 'CURL_SSLVERSION_TLSv1_2' ) ) {
                                 // Note the value 6 comes from its
 position in the enum that
                                 // defines it in cURL's source code.
                                 define( 'CURL_SSLVERSION_TLSv1_2', 6 ); //
 constant not defined in PHP < 5.5
                         }

                         curl_setopt( $curl, CURLOPT_SSLVERSION,
 CURL_SSLVERSION_TLSv1_2 );
                 } else {
                         if ( ! defined( 'CURL_SSLVERSION_TLSv1' ) ) {
                                 define( 'CURL_SSLVERSION_TLSv1', 1 ); //
 constant not defined in PHP < 5.5
                         }
                         curl_setopt( $curl, CURLOPT_SSLVERSION,
 CURL_SSLVERSION_TLSv1 );
                 }
         }
 }}}


 see https://github.com/woocommerce/woocommerce-gateway-
 stripe/pull/67/commits/877dcabf5c60ef6e41f770ecf654274fa1fc0ce5?diff=unified

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34924#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list