mirror of https://github.com/OpenKMIP/PyKMIP.git
Fixes premature server shutdown on receiving invalid certificate
This change fixes a bug with the server where the server would prematurely shutdown upon receiving a client connection using an invalid certificate. The server will now withstand bad client connections. The impacted server unit tests have been updated to reflect the bug fix.
This commit is contained in:
parent
cba8757f63
commit
94aacc1897
kmip
|
@ -298,12 +298,12 @@ class KmipServer(object):
|
|||
except socket.error as e:
|
||||
if e.errno == errno.EINTR:
|
||||
self._logger.warning("Interrupting connection service.")
|
||||
break
|
||||
else:
|
||||
self._logger.warning(
|
||||
"Error detected while establishing new connection."
|
||||
)
|
||||
self._logger.exception(e)
|
||||
break
|
||||
except Exception as e:
|
||||
self._logger.warning(
|
||||
"Error detected while establishing new connection."
|
||||
|
|
|
@ -381,7 +381,7 @@ class TestKmipServer(testtools.TestCase):
|
|||
s._is_serving = True
|
||||
s._logger.reset_mock()
|
||||
s._socket.accept = mock.MagicMock(
|
||||
side_effect=[unexpected_error]
|
||||
side_effect=[unexpected_error, expected_error]
|
||||
)
|
||||
|
||||
s.serve()
|
||||
|
|
Loading…
Reference in New Issue