Skip to content

Commit

Permalink
Fix broken integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 committed Sep 22, 2021
1 parent aaa1a1f commit 6a9eea4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/integration/templates/test_integration.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import spnego.tls
import ssl
import struct
import subprocess
import sys
import tempfile
import uuid
import warnings
Expand Down Expand Up @@ -693,7 +694,7 @@ def test_winrm_credssp(target, protocol, tls_protocol):
tls_context.context.maximum_version = ver
except (ValueError, AttributeError):
remove_opt = ssl.Options.OP_NO_TLSv1_2 if tls_protocol == "TLSv1.2" else ssl.Options.OP_NO_TLSv1_3
tls_context.context.options |= ~remove_opt
tls_context.context.options |= (default_opt & ~remove_opt)

client_kwargs["credssp_tls_context"] = tls_context

Expand All @@ -709,7 +710,9 @@ def test_winrm_credssp(target, protocol, tls_protocol):
assert stderr == ''
assert c.negotiated_protocol == protocol

if tls_protocol:
# Python 3.6 on Windows seems to always report it as TLSv1.0 but on packet inspection it really is correct.
# Just ignoring that particular version with this check.
if tls_protocol and (os.name != 'nt' or sys.version_info > (3,7)):
assert c._tls_object.cipher()[1] == tls_protocol


Expand Down

0 comments on commit 6a9eea4

Please sign in to comment.