Package tlslite :: Module messages :: Class ClientHello
[hide private]
[frames] | no frames]

Class ClientHello

source code


Class for handling the ClientHello TLS message, supports both the SSLv2 and SSLv3 style messages.

Instance Methods [hide private]
 
__init__(self, ssl2=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
str
__repr__(self)
Return machine readable representation of Client Hello
source code
str
__str__(self)
Return human readable representation of Client Hello
source code
 
_write(self)
Serialise SSLv3 or TLS object to on the wire data
source code
 
_writeSSL2(self)
Serialise SSLv2 object to on the wire data
source code
 
addExtension(self, ext)
Adds extension to internal list of extensions
source code
 
create(self, version, random, session_id, cipher_suites, certificate_types=None, srpUsername=None, tack=False, supports_npn=False, serverName=None, extensions=None)
Create a ClientHello message for sending.
source code
tlslite.extensions.TLSExtension
getExtension(self, extType)
Returns extension of given type if present, None otherwise
source code
 
parse(self, p)
Deserialise object from on the wire data
source code
 
write(self)
Serialise object to on the wire data
source code

Inherited from HandshakeMsg: postWrite

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Instance Variables [hide private]
list certificate_types
list of supported certificate types (deprecated)
list of TLSExtension extensions
list of TLS extensions parsed from wire or to send, see TLSExtension and child classes for exact examples
bytearray server_name
first host_name (type 0) present in SNI extension (deprecated)
bytearray srp_username
name of the user in SRP extension (deprecated)
boolean supports_npn
NPN extension presence (deprecated)
boolean tack
TACK extension presence (deprecated)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ssl2=False)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

Return machine readable representation of Client Hello

Returns: str
Overrides: object.__repr__

__str__(self)
(Informal representation operator)

source code 

Return human readable representation of Client Hello

Returns: str
Overrides: object.__str__

addExtension(self, ext)

source code 

Adds extension to internal list of extensions

Parameters:
  • ext (TLSExtension) - extension object to add to list

create(self, version, random, session_id, cipher_suites, certificate_types=None, srpUsername=None, tack=False, supports_npn=False, serverName=None, extensions=None)

source code 

Create a ClientHello message for sending.

Parameters:
  • version (tuple) - the highest supported TLS version encoded as two int tuple
  • random (bytearray) - client provided random value, in old versions of TLS (before 1.2) the first 32 bits should include system time, also used as the "challenge" field in SSLv2
  • session_id (bytearray) - ID of session, set when doing session resumption
  • cipher_suites (list) - list of ciphersuites advertised as supported
  • certificate_types (list) - list of supported certificate types, uses TLS extension for signalling, as such requires TLS1.0 to work
  • srpUsername (bytearray) - utf-8 encoded username for SRP, TLS extension
  • tack (boolean) - whatever to advertise support for TACK, TLS extension
  • supports_npn (boolean) - whatever to advertise support for NPN, TLS extension
  • serverName (bytearray) - the hostname to request in server name indication extension, TLS extension. Note that SNI allows to set multiple hostnames and values that are not hostnames, use SNIExtension together with extensions to use it.
  • extensions (list of TLSExtension) - list of extensions to advertise

getExtension(self, extType)

source code 

Returns extension of given type if present, None otherwise

Returns: tlslite.extensions.TLSExtension
Raises:

Instance Variable Details [hide private]

certificate_types

list of supported certificate types (deprecated)
Get Method:
unreachable.certificate_types(self) - Returns the list of certificate types supported.
Set Method:
unreachable.certificate_types(self, val) - Sets the list of supported types to list given in val if the cert_type extension is present.

Deprecated: use extensions field to get the extension for inspection

server_name

first host_name (type 0) present in SNI extension (deprecated)
Get Method:
unreachable.server_name(self) - Returns first host_name present in SNI extension
Set Method:
unreachable.server_name(self, hostname) - Sets the first host_name present in SNI extension
Type:
bytearray

Deprecated: use extensions field to get the extension for inspection

srp_username

name of the user in SRP extension (deprecated)
Get Method:
unreachable.srp_username(self) - Returns username for the SRP.
Set Method:
unreachable.srp_username(self, name) - Sets the username for SRP.

Deprecated: use extensions field to get the extension for inspection

supports_npn

NPN extension presence (deprecated)
Get Method:
unreachable.supports_npn(self) - Returns whatever client supports NPN extension
Set Method:
unreachable.supports_npn(self, present) - Creates or deletes the NPN extension
Type:
boolean

Deprecated: use extensions field to get the extension for inspection

tack

TACK extension presence (deprecated)
Get Method:
unreachable.tack(self) - Returns whatever the client supports TACK
Set Method:
unreachable.tack(self, present) - Creates or deletes the TACK extension.
Type:
boolean

Deprecated: use extensions field to get the extension for inspection