Bug 1289205

Summary: use the default min/max TLS version provided by NSS [RHEL-6]
Product: Red Hat Enterprise Linux 6 Reporter: Martin Poole <mpoole>
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: high Docs Contact: Petr Bokoc <pbokoc>
Priority: urgent    
Version: 6.7CC: ahuchcha, daiki.matsuda, emrakova, fkrska, freznice, hajek, jsantos, kdudka, mkolbas, mmckinst, mschena, ovasik, pbokoc, srandhaw, steevithak, tasander, tmraz, wharris
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: curl-7.19.7-50.el6 Doc Type: Enhancement
Doc Text:
TLS 1.1 and 1.2 are now enabled by default in *libcurl* Previously, versions 1.1 and 1.2 of the TLS protocol were disabled by default in *libcurl*. Users were required to explicitly enable these TLS versions in utilities based on *libcurl* in order to allow these utilities to securely communicate with servers that do not accept SSL 3.0 and TLS 1.0 connections. With this update, TLS 1.1 and TLS 1.2 are no longer disabled by default in *libcurl*. You can, however, explicitly disable them using the libcurl API.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 00:36:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1170339, 1272504, 1299564    
Bug Blocks: 1172231, 1253743, 1271238, 1289134, 1310222    

Description Martin Poole 2015-12-07 16:37:08 UTC
Description of problem:

As a follow-on from 

  Bug 1012136 - [RFE] option to enable TLS 1.2 in curl

to fulfill the requirements of 

   1253743 [NEW high] update RHEL 6 components that do not yet support TLS 1.2

libcurl needs to enable TLSv1.2 by default (or enable use of highest available as provided by installed by nss).

Comment 4 Steevithak 2016-01-08 18:01:20 UTC
What's the ETA on this? We've got an ecommerce app running on RHEL 6 that relies on PHP/libcurl and has to meet the new PCI requirements for TLS 1.2 by Jan 15. I've been debugging the problem for days and finally stumbled onto this bug.

Is there a testing version of libcurl or anything I can do as a temporary measure to get PHP/libcurl to force TLS 1.2? Or is moving to RHEL 7.0 our best bet for fixing this in our timeframe?

Comment 5 Kamil Dudka 2016-01-08 18:12:34 UTC
(In reply to Steevithak from comment #4)
> What's the ETA on this?

I believe the fix for this bug will be included in RHEL-6.8.

> Is there a testing version of libcurl or anything I can do as a temporary
> measure to get PHP/libcurl to force TLS 1.2?

As for libcurl, you can force TLS 1.2 by using the CURLOPT_SSLVERSION option.  Note that even if this bug (and bug #1272504) are fixed, TLS 1.2 will not be forced, but only enabled by default.

> Or is moving to RHEL 7.0 our
> best bet for fixing this in our timeframe?

As you suggest, this is already fixed in RHEL-7.  See bug #1170339 for details.

Comment 6 Mark McKinstry 2016-01-08 18:39:39 UTC
Steevithak,

I created a patched RPM a month back when it looked like this wasn't going to be fixed in RHEL 6. You can find it at https://github.com/mmckinst/curl-el6 , the patch is https://github.com/mmckinst/curl-el6/blob/master/SOURCES/curl-7.19.7-bz1042989.patch . This is my custom RPM and not supported by Red Hat but its out there if you or anyone else wants to use it before its officially fixed in RHEL 6.8.

Comment 7 Steevithak 2016-01-08 20:19:33 UTC
Mark: Thanks, downloading now!

Kamil: I've verified that our scripts use TLS 1.2 on RHEL 7 but on RHEL 6 they report TLS 1.0. Maybe "force" is a bad choice of words on my part but I'm just looking for any way to cause RHEL 6 libcurl to use TLS 1.2. I'm happy with "enabling" it if there's a way to do that. I've already looked at CURLOPT_SSLVERSION but haven't found a setting that turns it on - can you recommend a specific setting there? I've tried adding this line to our php code:

curl_setopt($c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2) 

But it seems to have no effect and TLS 1.0 is still used.

Comment 8 Kamil Dudka 2016-01-08 20:29:52 UTC
(In reply to Steevithak from comment #7)
> I've tried adding this line to our php code:
> 
> curl_setopt($c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2) 
> 
> But it seems to have no effect and TLS 1.0 is still used.

With el6 libcurl, CURL_SSLVERSION_TLSv1_2 means "TLS 1.2 only" whereas CURL_SSLVERSION_TLSv1 means "TLS 1.x".  Both of them are known to work.

I am not sure about the PHP binding.  If you think it does not work, please file a separate bug report with some steps to reproduce.

Comment 9 Steevithak 2016-01-08 21:48:10 UTC
(In reply to Kamil Dudka from comment #8)
> With el6 libcurl, CURL_SSLVERSION_TLSv1_2 means "TLS 1.2 only" whereas
> CURL_SSLVERSION_TLSv1 means "TLS 1.x".  Both of them are known to work.
> 
> I am not sure about the PHP binding.  If you think it does not work, please
> file a separate bug report with some steps to reproduce.

Interesting. I looked into this further and discovered that the constant value for CURL_SSLVERSION_TLSv1_2 is 6. If I do this:

 curl_setopt($c, CURLOPT_SSLVERSION, 6) 

It actually does connect with TLS 1.2! 

However, doing this:

 curl_setopt($c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2) 

has no effect and I still get a TLS 1.0 connection. So the existing libcurl actually does work but somehow the constant isn't defined (or isn't correct) within PHP. I'll investigate this more and file another bug if needed. Thanks!

However, everything works fine on CentOS 7 and with Mark's libcurl on CentOS 6 (because TLS 1.2 works by default, so I don't need to set CURLOPT).

Comment 10 Kamil Dudka 2016-01-08 23:58:53 UTC
(In reply to Steevithak from comment #9)
> Interesting. I looked into this further and discovered that the constant
> value for CURL_SSLVERSION_TLSv1_2 is 6. If I do this:
> 
>  curl_setopt($c, CURLOPT_SSLVERSION, 6) 
> 
> It actually does connect with TLS 1.2! 
> 
> However, doing this:
> 
>  curl_setopt($c, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2) 
> 
> has no effect and I still get a TLS 1.0 connection. So the existing libcurl
> actually does work but somehow the constant isn't defined (or isn't correct)
> within PHP.

Looks like bug #1255920.

Comment 13 Valentina Mukhamedzhanova 2016-01-19 12:02:44 UTC
*** Bug 1162746 has been marked as a duplicate of this bug. ***

Comment 15 Kamil Dudka 2016-01-29 20:09:39 UTC
*** Bug 1303186 has been marked as a duplicate of this bug. ***

Comment 26 Kamil Dudka 2016-04-18 06:32:15 UTC
*** Bug 1327919 has been marked as a duplicate of this bug. ***

Comment 28 errata-xmlrpc 2016-05-11 00:36:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0915.html