Changeset 2885 for TI12-security/trunk/python/ndg.security.common/ndg/security/common/m2CryptoSSLUtility.py
- Timestamp:
- 14/09/07 09:41:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.common/ndg/security/common/m2CryptoSSLUtility.py
r2884 r2885 116 116 117 117 class HTTPSConnection(_HTTPSConnection): 118 118 """Modified version of M2Crypto equivalent to enable custom checks with 119 the peer and timeout settings 120 121 @type defReadTimeout: M2Crypto.SSL.timeout 122 @cvar defReadTimeout: default timeout for read operations 123 @type defWriteTimeout: M2Crypto.SSL.timeout 124 @cvar defWriteTimeout: default timeout for write operations""" 125 defReadTimeout = SSL.timeout(sec=3.) 126 defWriteTimeout = SSL.timeout(sec=3.) 127 119 128 def __init__(self, *args, **kw): 120 129 '''Overload to enable setting of post connection check 121 callback to SSL.Connection''' 130 callback to SSL.Connection 131 132 type *args: tuple 133 param *args: args which apply to M2Crypto.httpslib.HTTPSConnection 134 type **kw: dict 135 param **kw: additional keywords - postConnectionCheck - set class for 136 checking peer, readTimeout - M2Crypto.SSL.timeout instance - set 137 timeout for read, similarly writeTimeout''' 138 122 139 if 'postConnectionCheck' in kw: 123 140 self._postConnectionCheck = kw['postConnectionCheck'] … … 133 150 del kw['readTimeout'] 134 151 else: 135 self.readTimeout = SSL.timeout(sec=3.)152 self.readTimeout = HTTPSConnection.defReadTimeout 136 153 137 154 if 'writeTimeout' in kw: … … 142 159 del kw['writeTimeout'] 143 160 else: 144 self.writeTimeout = SSL.timeout(sec=3.)161 self.writeTimeout = HTTPSConnection.defWriteTimeout 145 162 146 163 _HTTPSConnection.__init__(self, *args, **kw)
Note: See TracChangeset
for help on using the changeset viewer.