trevp/tlslite — pull request #10 by marcelofernandez (2012-10-03 04:43:01+00:00)
Title: More NPN Tests and docstrings

I've added this test cases:

References:
1 = 'http/1.1'
2 = 'spdy/2'
3 = 'spdy/3'

Client / Server = Correct Client Choice
Test 1: 1 / 1 = 1
Test 2: 2, 1 / 2, 1 = 2
Test 3: 2, 1 / 1, 2 = 2
Test 4: 3, 2, 1 / 2, 1 = 2
Test 5: 3, 2, 1 / 1, 2, 3 = 3
Test 6: 1 / 3, 2 = 1
Test 7: 1, 2 / [] = 1

Test 6 and 7 are the "corner" cases we were talking about. According the IETF draft spec [1]: "In the event that the client doesn't support any of server's protocols (Test 6), or the server doesn't advertise any (Test 7), it SHOULD select the first protocol that it supports. (http/1.1)".

Another thing I've added are docstrings in the handshakeClientCert() and handshakeServer() methods.

I don't know if it's needed to add nextProtos parameter to the handshakeClientSRP() and handshakeClientAnonymous() calls, to support NPN in those calls too.

[1] https://tools.ietf.org/html/draft-agl-tls-nextprotoneg-04

Regards