RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1446538 - SSL not working for OVN on CentOS 7
Summary: SSL not working for OVN on CentOS 7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openvswitch
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Lance Richardson
QA Contact: qding
URL:
Whiteboard:
Depends On:
Blocks: 1396143 1448867
TreeView+ depends on / blocked
 
Reported: 2017-04-28 10:12 UTC by Marcin Mirecki
Modified: 2017-07-12 15:56 UTC (History)
10 users (show)

Fixed In Version: openvswitch-2.7.0-3.git20170516.el7fdb
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-12 15:49:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marcin Mirecki 2017-04-28 10:12:15 UTC
Using the python-openvswitch to connect to OVN db's does not work when OVN is configured for SSL.

Steps to reproduce:

Configure OVN for SSL:
ovn-nbctl set-ssl ./keys/ovn-ndb.key.nopass ./certs/ovn-ndb.cer ./ca.pem
ovn-nbctl set-connection pssl:6641

Try connecting to OVN:
ovs.db.idl.Idl('ssl:127.0.0.1:6641', schema_helper).run()

Result:
No connection, OVN db logs do not show any connection, tcpdump does not show any traffic.

Reason:
The pyOpenSSL package on Centos seems to be missing some functionality:
x'OpenSSL.SSL.Context' object has no attribute 'set_session_cache_mode'

also it might be nice to include pyOpenSSL as a 'require' in the python-openvswitch rpm (although it is not needed when not using SSL, so this might not be doable).

Workaround:
Install the fedora version of pyOpenSSL, version: pyOpenSSL-16.2.0-1.fc25.noarch.rpm
this solves this specific problem

Comment 2 Lance Richardson 2017-05-01 12:09:02 UTC
Recently-added support for SSL in the Python ovsdb API requires a newer
version of the pyopenssl package than present in RHEL7 or CentOS 7. This
is not specific to OVN.

Added Numan to cc: list as he is looking into an upstream fix for this issue.

Comment 3 Dan Kenigsberg 2017-05-11 10:09:22 UTC
Lance/Numan, this is quite bad, as it makes the recent encryption support useless on production, where it is most importantly needed.

Which version of pyopenssl is required to enable encryption in OVN?
Could you ask RHEL-7.4 to have it?
If not, we may have to push it into the fast datapath.

Comment 5 Numan Siddique 2017-05-15 13:10:26 UTC
I am looking into this issue and see if this can support v0.13 of pyopenssl and I will update the same here. But I feel it's good if v0.14, v16 or above is used since v0.13 is very old.

On fedora I see the version pyOpenSSL-16.2.0-1.fc25.noarch

Comment 6 Numan Siddique 2017-05-15 15:06:36 UTC
Submitted the patch upstream to address this issue in pyOpenSSL v0.13

https://patchwork.ozlabs.org/patch/762560/

Comment 7 Numan Siddique 2017-05-24 07:51:02 UTC
The patch is now merged in upstream master and upstream branch 2.7

Comment 9 Lance Richardson 2017-05-26 16:51:43 UTC
Fix has been backported to ovs 2.7 fd beta package, a build is available here
for testing:

    https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=560605

Comment 11 qding 2017-06-08 08:28:02 UTC
[root@dell-per730-26 ~]# rpm -q pyOpenSSL
pyOpenSSL-0.13.1-3.el7.x86_64

+++ Reproduce with openvswitch-2.7.0-1.git20170516.el7fdb

## ----------------------------- ##
## openvswitch 2.7.0 test suite. ##
## ----------------------------- ##
...

2108: simple idl verify notify - SSL                  skipped (ovsdb-idl.at:1215)

[root@dell-per730-25 ~]# sed  '767,773!d;=' /usr/lib/python2.7/site-packages/ovs/stream.py | sed 'N;s/\n/:/'
767:        ctx = SSL.Context(SSL.SSLv23_METHOD)
768:        ctx.set_verify(SSL.VERIFY_PEER, SSLStream.verify_cb)
769:        ctx.set_options(SSL.OP_NO_SSLv2 | SSL.OP_NO_SSLv3)
770:        ctx.set_session_cache_mode(SSL.SESS_CACHE_OFF)
771:        # If the client has not set the SSL configuration files
772:        # exception would be raised.
773:        ctx.use_privatekey_file(Stream._SSL_private_key_file)
[root@dell-per730-25 ~]# 


+++ Verify with openvswitch-2.7.0-8.git20170530.el7fdb
## ----------------------------- ##
## openvswitch 2.7.0 test suite. ##
## ----------------------------- ##
...

2110: simple idl verify notify - SSL                  ok

[root@dell-per730-26 ~]# sed  '767,773!d;=' /usr/lib/python2.7/site-packages/ovs/stream.py | sed 'N;s/\n/:/'
767:        ctx = SSL.Context(SSL.SSLv23_METHOD)
768:        ctx.set_verify(SSL.VERIFY_PEER, SSLStream.verify_cb)
769:        ctx.set_options(SSL.OP_NO_SSLv2 | SSL.OP_NO_SSLv3)
770:        # If the client has not set the SSL configuration files
771:        # exception would be raised.
772:        ctx.use_privatekey_file(Stream._SSL_private_key_file)
773:        ctx.use_certificate_file(Stream._SSL_certificate_file)
[root@dell-per730-26 ~]#


Note You need to log in before you can comment on or make changes to this bug.