Package tlslite :: Module extensions :: Class ALPNExtension
[hide private]
[frames] | no frames]

type ALPNExtension

source code


Handling of Application Layer Protocol Negotiation extension from RFC 7301.

Instance Methods [hide private]
 
__init__(self)
Create instance of ALPNExtension
source code
str
__repr__(self)
Create programmer-readable representation of object
source code
TLSExtension
create(self, protocol_names=None)
Create an instance of ALPNExtension with specified protocols
source code
ALPNExtension
parse(self, parser)
Parse the extension from on the wire format
source code

Inherited from TLSExtension: __eq__, write

Inherited from TLSExtension (private): _newCreate, _oldCreate

Static Methods [hide private]

Inherited from TLSExtension (private): _parseExt

Class Variables [hide private]
Instance Variables [hide private]
bytearray extData
a byte array containing the value of the extension as to be written on the wire
int extType
a 2^16-1 limited integer specifying the type of the extension that it contains, e.g.
list of bytearrays protocol_names
list of protocol names acceptable or selected by peer

Inherited from TLSExtension: serverType

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Create instance of ALPNExtension

See also: create and parse

Parameters:
  • server - whether to select ClientHello or ServerHello version for parsing
  • extType - type of extension encoded as an integer, to be used by subclasses
Overrides: TLSExtension.__init__

__repr__(self)
(Representation operator)

source code 

Create programmer-readable representation of object

Returns: str
Overrides: TLSExtension.__repr__

create(self, protocol_names=None)

source code 

Create an instance of ALPNExtension with specified protocols

Parameters:
  • protocols (list of bytearray) - list of protocol names that are to be sent
Returns: TLSExtension
Overrides: TLSExtension.create

parse(self, parser)

source code 

Parse the extension from on the wire format

Parameters:
Returns: ALPNExtension
Raises:
  • SyntaxError - when the encoding of the extension is self inconsistent
Overrides: TLSExtension.parse

Instance Variable Details [hide private]

extData

a byte array containing the value of the extension as to be written on the wire
Type:
bytearray

extType

a 2^16-1 limited integer specifying the type of the extension that it contains, e.g. 0 indicates server name extension
Type:
int