checkALPN ensure that the server's choice of ALPN protocol is compatible with the protocols that we advertised in the Client Hello.
(clientProtos []string, serverProto string)
| 750 | // checkALPN ensure that the server's choice of ALPN protocol is compatible with |
| 751 | // the protocols that we advertised in the Client Hello. |
| 752 | func checkALPN(clientProtos []string, serverProto string) error { |
| 753 | if serverProto == "" { |
| 754 | return nil |
| 755 | } |
| 756 | if len(clientProtos) == 0 { |
| 757 | return errors.New("tls: server advertised unrequested ALPN extension") |
| 758 | } |
| 759 | for _, proto := range clientProtos { |
| 760 | if proto == serverProto { |
| 761 | return nil |
| 762 | } |
| 763 | } |
| 764 | return errors.New("tls: server selected unadvertised ALPN protocol") |
| 765 | } |
| 766 | |
| 767 | func (hs *clientHandshakeState) readFinished(out []byte) error { |
| 768 | c := hs.c |
no outgoing calls
no test coverage detected
searching dependent graphs…