The ssl.get_server_certificate method uses SSLv3 by default.
Support for SSLv3 was dropped on the backend controller in
response to the POODLE vulnerability. This patch fixes it
to use TLSv1 like the wrap_socket method.
Closes-Bug: #
1384487
Change-Id: I9cb5f219d327d62168bef2d7dbee22534b2e454e
(cherry picked from commit
77e283c94f51e21dcf126a316098c54a7cdfca0f)
a given path.
'''
try:
- cert = ssl.get_server_certificate((server, port))
+ cert = ssl.get_server_certificate((server, port),
+ ssl_version=ssl.PROTOCOL_TLSv1)
except Exception as e:
raise cfg.Error(_('Could not retrieve initial '
'certificate from controller %(server)s. '
pl.servers._get_combined_cert_for_server,
*('example.org', 443)
)
- sslgetmock.assert_has_calls([mock.call(('example.org', 443))])
+ sslgetmock.assert_has_calls([mock.call(
+ ('example.org', 443), ssl_version=ssl.PROTOCOL_TLSv1)])
def test_consistency_watchdog_stops_with_0_polling_interval(self):
pl = manager.NeutronManager.get_plugin()
# under the License.
import contextlib
import os
+import ssl
import mock
from oslo.config import cfg
self.getcacerts_m.assert_has_calls([mock.call(self.ca_certs_path)])
# cert should have been fetched via SSL lib
self.sslgetcert_m.assert_has_calls(
- [mock.call((self.servername, 443))]
+ [mock.call((self.servername, 443),
+ ssl_version=ssl.PROTOCOL_TLSv1)]
)
# cert should have been recorded