Bug 1154776

Summary: Add API call for SSL_VersionRangeSet (rebase)
Product: Red Hat Enterprise Linux 6 Reporter: Rob Crittenden <rcritten>
Component: python-nssAssignee: John Dennis <jdennis>
Status: CLOSED ERRATA QA Contact: Stanislav Zidek <szidek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.7CC: adingman, jdennis, nkinder, perobins, salmy, szidek
Target Milestone: rcKeywords: Rebase
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-nss-0.16.0-1.el6 Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
The python-nss packages have been upgraded to upstream version 0.16.0, which provides a number of bug fixes and enhancements over the previous version, including: * Added support for setting trust attributes on a certificate. * Added support for the SSL version range API, information on the SSL cipher suites, and information on the SSL connection. (BZ#1154776)
Story Points: ---
Clone Of:
: 1155703 (view as bug list) Environment:
Last Closed: 2015-07-22 06:34:05 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:
Bug Depends On:    
Bug Blocks: 1154687, 1155703, 1156466, 1175494    

Description Rob Crittenden 2014-10-20 18:02:13 UTC
Description of problem:

The old protocol API for NSS allows only SSL2, SSL3 and TLS1.0. A new API was added to specify the min/max of the allowed range, SSL_VersionRangeSet. We need that in order to be able to enable the client to use TLS v1.1 and TLS v1.2

Version-Release number of selected component (if applicable):

python-nss-0.13-1.el6

How reproducible:


Steps to Reproduce:
1. Install IPA server
2. Update /etc/httpd/conf.d/nss.conf and set NSSProtocol to TLSv1.1
3. ipa -vv user-show admin

Actual results:

(SSL_ERROR_PROTOCOL_VERSION_ALERT) Peer reports incompatible or unsupported protocol version.

This is because only SSL3 and TLSv1 are enabled by default and there is no mechanism to enable them.

Comment 1 John Dennis 2014-10-22 16:28:04 UTC
Rob, there is a Fedora scratch build here for a trial 0.16.0 version:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7930311

It includes all the SSL version range API calls (as well as the ability to set trust properites on Certificates that someone else had requested). Examples of using the SSL version range stuff can be found in doc/examples/ssl_version_range.py

I'd rather not go through the effort of doing an official Mozilla release and RHEL builds until you sanity check this trial version. Would you please do that and report back? Thanks!

Comment 2 John Dennis 2014-10-27 14:55:28 UTC
In IRC Rob asked to augment the new verson with support for

SSLCipherSuiteInfo

In addition to that

SSLChannelInfo

was added which can be querried off a SSLSocket object, also SSLSocket.get_negotiated_host() was added.

However the information in SSLCipherSuiteInfo and SSLChannelInfo is often best combined together in an integrated fashion so SSLSocket now also supports a connection_info_str() method which dumps out the information on the parameters of the SSL connection as it was established. For example if you have a handshake callback you could dump information this way:

def handshake_callback(sock):
    print "-- handshake complete --"
    print "peer: %s" % (sock.get_peer_name())
    print "negotiated host: %s" % (sock.get_negotiated_host())
    print
    print sock.connection_info_str()
    print "-- handshake complete --"
    print

An example of which is shown below:

-- handshake complete --
peer: 69.58.181.89:443
negotiated host: www.verisign.com

SSL Protocol Version: 3.1 (tls1.0)
Cipher:               128-bit AES
MAC:                  160-bit SHA1
Auth:                 2048-bit RSA
Key Exchange:         1024-bit DHE
Compression:          NULL
-- handshake complete --

Of course all the individual data items from SSLCipherSuiteInfo and SSLConnectionInfo can be directly accessed as well as printed in a friendly form. 

In all 46 new methods were added to support the above.

It should now be version easy when trying to establish the SSL protocol version to see the exact SSL connection and cipher parameters in use.

Also when using SSLCipherSuiteInfo don't forget there has always been a tuple of supported ssl cipher suites avalable as

ssl.ssl_implemented_ciphers

and dumping them is now as simple as:

for cipher in ssl.ssl_implemented_ciphers:
    suite_info = ssl.get_cipher_suite_info(cipher)
    print suite_info
    print

A scratch build and the updated SRPM can be found here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7948072

Please test and report.

Comment 3 John Dennis 2014-10-27 21:13:41 UTC
My appologies, the scratch build and SRPM mentioned in comment #2 was incorrect

The correct scratch build and the updated SRPM can be found here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7952038

Comment 4 Rob Crittenden 2014-10-28 18:37:25 UTC
Tested out in ipa tool ok for me.

Comment 11 errata-xmlrpc 2015-07-22 06:34:05 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-2015-1324.html