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

type ClientHello

source code


Class for handling the ClientHello SSLv2/SSLv3/TLS message.

Instance Methods [hide private]
 
__init__(self, ssl2=False)
Initialize object.
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
 
create(self, version, random, session_id, cipher_suites, certificate_types=None, srpUsername=None, tack=False, supports_npn=None, serverName=None, extensions=None)
Create a ClientHello message for sending.
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 HelloMessage: addExtension, getExtension

Inherited from HelloMessage (private): _addExt, _addOrRemoveExt, _removeExt

Inherited from HandshakeMsg: postWrite

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)
Method Details [hide private]

__init__(self, ssl2=False)
(Constructor)

source code 

Initialize object.

Overrides: HandshakeMsg.__init__

__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__

create(self, version, random, session_id, cipher_suites, certificate_types=None, srpUsername=None, tack=False, supports_npn=None, 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

Instance Variable Details [hide private]

certificate_types

list of supported certificate types (deprecated)

Deprecated: use extensions field to get the extension for inspection

server_name

first host_name (type 0) present in SNI extension (deprecated)
Type:
bytearray

Deprecated: use extensions field to get the extension for inspection

srp_username

name of the user in SRP extension (deprecated)

Deprecated: use extensions field to get the extension for inspection

supports_npn

NPN extension presence (deprecated)
Type:
boolean

Deprecated: use extensions field to get the extension for inspection

tack

TACK extension presence (deprecated)
Type:
boolean

Deprecated: use extensions field to get the extension for inspection