Workaround for Windows concerning the MTU size
* dtls/sslconnection.py: Hardcoded setting of the MTU size only for Windows and in case it is not already configured * dtls/test/unit_wrapper.py: No user config of the MTU size; using the hardcoded one from SSLConnectionincoming
parent
083554e9e0
commit
8716df8ead
|
@ -1,3 +1,10 @@
|
||||||
|
2017-03-28 Björn Freise <mcfreis@gmx.net>
|
||||||
|
|
||||||
|
Workaround for Windows concerning the MTU size
|
||||||
|
|
||||||
|
* dtls/sslconnection.py: Hardcoded setting of the MTU size only for Windows and in case it is not already configured
|
||||||
|
* dtls/test/unit_wrapper.py: No user config of the MTU size; using the hardcoded one from SSLConnection
|
||||||
|
|
||||||
2017-03-28 Björn Freise <mcfreis@gmx.net>
|
2017-03-28 Björn Freise <mcfreis@gmx.net>
|
||||||
|
|
||||||
Minor fixes and "hopefully" compatible to Ubuntu 16.04
|
Minor fixes and "hopefully" compatible to Ubuntu 16.04
|
||||||
|
|
|
@ -40,6 +40,7 @@ library's ssl module, since its values can be passed to this module.
|
||||||
CERT_REQUIRED
|
CERT_REQUIRED
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
import errno
|
import errno
|
||||||
import socket
|
import socket
|
||||||
import hmac
|
import hmac
|
||||||
|
@ -560,9 +561,11 @@ class SSLConnection(object):
|
||||||
|
|
||||||
if self._user_config_ssl:
|
if self._user_config_ssl:
|
||||||
self._user_config_ssl(self._intf_ssl)
|
self._user_config_ssl(self._intf_ssl)
|
||||||
else:
|
|
||||||
|
if sys.platform.startswith('win') and not (SSL_get_options(self._ssl.value) & SSL_OP_NO_QUERY_MTU):
|
||||||
SSL_set_options(self._ssl.value, SSL_OP_NO_QUERY_MTU)
|
SSL_set_options(self._ssl.value, SSL_OP_NO_QUERY_MTU)
|
||||||
DTLS_set_link_mtu(self._ssl.value, 1500)
|
DTLS_set_link_mtu(self._ssl.value, 1500)
|
||||||
|
|
||||||
SSL_set_bio(self._ssl.value, self._rbio.value, self._wbio.value)
|
SSL_set_bio(self._ssl.value, self._rbio.value, self._wbio.value)
|
||||||
self._rbio.disown()
|
self._rbio.disown()
|
||||||
self._wbio.disown()
|
self._wbio.disown()
|
||||||
|
|
|
@ -378,7 +378,7 @@ def params_test(start_server, certfile, protocol, certreqs, cacertsfile,
|
||||||
client_certfile=None, client_protocol=None, client_certreqs=None, client_cacertsfile=None,
|
client_certfile=None, client_protocol=None, client_certreqs=None, client_cacertsfile=None,
|
||||||
ciphers=None, curves=None, sigalgs=None,
|
ciphers=None, curves=None, sigalgs=None,
|
||||||
client_ciphers=None, client_curves=None, client_sigalgs=None,
|
client_ciphers=None, client_curves=None, client_sigalgs=None,
|
||||||
mtu=1500, server_key_exchange_curve=None, server_cert_options=None,
|
mtu=None, server_key_exchange_curve=None, server_cert_options=None,
|
||||||
indata="FOO\n", chatty=False, connectionchatty=False):
|
indata="FOO\n", chatty=False, connectionchatty=False):
|
||||||
"""
|
"""
|
||||||
Launch a server, connect a client to it and try various reads
|
Launch a server, connect a client to it and try various reads
|
||||||
|
@ -508,7 +508,7 @@ class WrapperTests(unittest.TestCase):
|
||||||
ciphers=None,
|
ciphers=None,
|
||||||
curves=None,
|
curves=None,
|
||||||
sigalgs=None,
|
sigalgs=None,
|
||||||
mtu=1500,
|
mtu=None,
|
||||||
server_key_exchange_curve=None,
|
server_key_exchange_curve=None,
|
||||||
server_cert_options=step,
|
server_cert_options=step,
|
||||||
chatty=chatty)
|
chatty=chatty)
|
||||||
|
@ -526,7 +526,7 @@ class WrapperTests(unittest.TestCase):
|
||||||
ciphers=None,
|
ciphers=None,
|
||||||
curves=None,
|
curves=None,
|
||||||
sigalgs=None,
|
sigalgs=None,
|
||||||
user_mtu=1500)
|
user_mtu=None)
|
||||||
s.connect((HOST, server.port))
|
s.connect((HOST, server.port))
|
||||||
if connectionchatty:
|
if connectionchatty:
|
||||||
sys.stdout.write(" client: sending %s...\n" % (repr(indata)))
|
sys.stdout.write(" client: sending %s...\n" % (repr(indata)))
|
||||||
|
@ -595,7 +595,7 @@ class WrapperTests(unittest.TestCase):
|
||||||
ciphers=None,
|
ciphers=None,
|
||||||
curves=None,
|
curves=None,
|
||||||
sigalgs=None,
|
sigalgs=None,
|
||||||
mtu=1500,
|
mtu=None,
|
||||||
server_key_exchange_curve=server_curve,
|
server_key_exchange_curve=server_curve,
|
||||||
server_cert_options=None,
|
server_cert_options=None,
|
||||||
chatty=chatty)
|
chatty=chatty)
|
||||||
|
@ -613,7 +613,7 @@ class WrapperTests(unittest.TestCase):
|
||||||
ciphers=None,
|
ciphers=None,
|
||||||
curves=client_curve,
|
curves=client_curve,
|
||||||
sigalgs=None,
|
sigalgs=None,
|
||||||
user_mtu=1500)
|
user_mtu=None)
|
||||||
s.connect((HOST, server.port))
|
s.connect((HOST, server.port))
|
||||||
if connectionchatty:
|
if connectionchatty:
|
||||||
sys.stdout.write(" client: sending %s...\n" % (repr(indata)))
|
sys.stdout.write(" client: sending %s...\n" % (repr(indata)))
|
||||||
|
|
Loading…
Reference in New Issue