MCPcopy Create free account
hub / github.com/XTLS/Go / readServerParameters

Method readServerParameters

handshake_client_tls13.go:384–406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

382}
383
384func (hs *clientHandshakeStateTLS13) readServerParameters() error {
385 c := hs.c
386
387 msg, err := c.readHandshake()
388 if err != nil {
389 return err
390 }
391
392 encryptedExtensions, ok := msg.(*encryptedExtensionsMsg)
393 if !ok {
394 c.sendAlert(alertUnexpectedMessage)
395 return unexpectedMessageError(encryptedExtensions, msg)
396 }
397 hs.transcript.Write(encryptedExtensions.marshal())
398
399 if err := checkALPN(hs.hello.alpnProtocols, encryptedExtensions.alpnProtocol); err != nil {
400 c.sendAlert(alertUnsupportedExtension)
401 return err
402 }
403 c.clientProtocol = encryptedExtensions.alpnProtocol
404
405 return nil
406}
407
408func (hs *clientHandshakeStateTLS13) readServerCertificate() error {
409 c := hs.c

Callers 1

handshakeMethod · 0.95

Calls 6

unexpectedMessageErrorFunction · 0.85
checkALPNFunction · 0.85
readHandshakeMethod · 0.80
sendAlertMethod · 0.80
marshalMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected