mirror of
https://opendev.org/x/pyghmi
synced 2025-03-10 06:07:28 +00:00
Request a small MSS in web connection explicitly
Sometimes equipment will not handle some header data, such as 802.1q tag. Other times, there's a jumbo NIC talking to a BMC that is not jumbo. Workaround such situations by setting the MSS to 1456 explicitly, which fits in MTU 1500 plus 4 bytes for dot1q tag, if some intermediat device fails to handle that. Change-Id: I7db1c8feac1c094871723026771792432a3daaf4
This commit is contained in:
parent
2d517cf113
commit
19ae81f1dc
@ -81,7 +81,13 @@ class SecureHTTPConnection(httplib.HTTPConnection, object):
|
||||
self.stdheaders[key] = value
|
||||
|
||||
def connect(self):
|
||||
plainsock = socket.create_connection((self.host, self.port), 60)
|
||||
addrinfo = socket.getaddrinfo(self.host, self.port)[0]
|
||||
# workaround problems of too large mtu, moderately frequent occurance
|
||||
# in this space
|
||||
plainsock = socket.socket(addrinfo[0])
|
||||
plainsock.settimeout(60)
|
||||
plainsock.setsockopt(socket.IPPROTO_TCP, socket.TCP_MAXSEG, 1456)
|
||||
plainsock.connect(addrinfo[4])
|
||||
self.sock = ssl.wrap_socket(plainsock, cert_reqs=self.cert_reqs)
|
||||
# txtcert = self.sock.getpeercert() # currently not possible
|
||||
bincert = self.sock.getpeercert(binary_form=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user