Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kmip/services/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __init__(self, cipher_suites=None):
suites. Optional, defaults to None.
"""
super(BasicAuthenticationSuite, self).__init__(cipher_suites)
self._protocol = ssl.PROTOCOL_TLSv1
self._protocol = ssl.PROTOCOL_TLS_SERVER


class TLS12AuthenticationSuite(AuthenticationSuite):
Expand Down Expand Up @@ -231,4 +231,4 @@ def __init__(self, cipher_suites=None):
suites. Optional, defaults to None.
"""
super(TLS12AuthenticationSuite, self).__init__(cipher_suites)
self._protocol = ssl.PROTOCOL_TLSv1_2
self._protocol = ssl.PROTOCOL_TLS_SERVER
2 changes: 1 addition & 1 deletion kmip/tests/unit/pie/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_init(self):
cert='/example/path/to/cert',
key='/example/path/to/key',
ca='/example/path/to/ca',
ssl_version=ssl.PROTOCOL_TLSv1,
ssl_version=ssl.PROTOCOL_TLS_CLIENT,
username='username',
password='password',
config='test')
Expand Down
7 changes: 2 additions & 5 deletions kmip/tests/unit/services/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.

import pytest
import ssl
import testtools

Expand All @@ -39,7 +38,7 @@ def test_protocol(self):
protocol = suite.protocol

self.assertIsInstance(protocol, int)
self.assertEqual(ssl.PROTOCOL_TLSv1, suite.protocol)
self.assertEqual(ssl.PROTOCOL_TLS_SERVER, suite.protocol)

def test_ciphers(self):
suite = auth.BasicAuthenticationSuite()
Expand Down Expand Up @@ -119,8 +118,6 @@ def test_custom_ciphers_empty(self):
self.assertIn('DHE-RSA-AES256-SHA', suites)


@pytest.mark.skipif(not hasattr(ssl, 'PROTOCOL_TLSv1_2'),
reason="Requires ssl.PROTOCOL_TLSv1_2")
class TestTLS12AuthenticationSuite(testtools.TestCase):
"""
A test suite for the TLS12AuthenticationSuite.
Expand All @@ -140,7 +137,7 @@ def test_protocol(self):
protocol = suite.protocol

self.assertIsInstance(protocol, int)
self.assertEqual(ssl.PROTOCOL_TLSv1_2, suite.protocol)
self.assertEqual(ssl.PROTOCOL_TLS_SERVER, suite.protocol)

def test_ciphers(self):
suite = auth.TLS12AuthenticationSuite()
Expand Down