dialer_tls_go17.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // +build !go1.8
  2. package ws
  3. import "crypto/tls"
  4. func tlsCloneConfig(c *tls.Config) *tls.Config {
  5. // NOTE: we copying SessionTicketsDisabled and SessionTicketKey here
  6. // without calling inner c.initOnceServer somehow because we only could get
  7. // here from the ws.Dialer code, which is obviously a client and makes
  8. // tls.Client() when it gets new net.Conn.
  9. return &tls.Config{
  10. Rand: c.Rand,
  11. Time: c.Time,
  12. Certificates: c.Certificates,
  13. NameToCertificate: c.NameToCertificate,
  14. GetCertificate: c.GetCertificate,
  15. RootCAs: c.RootCAs,
  16. NextProtos: c.NextProtos,
  17. ServerName: c.ServerName,
  18. ClientAuth: c.ClientAuth,
  19. ClientCAs: c.ClientCAs,
  20. InsecureSkipVerify: c.InsecureSkipVerify,
  21. CipherSuites: c.CipherSuites,
  22. PreferServerCipherSuites: c.PreferServerCipherSuites,
  23. SessionTicketsDisabled: c.SessionTicketsDisabled,
  24. SessionTicketKey: c.SessionTicketKey,
  25. ClientSessionCache: c.ClientSessionCache,
  26. MinVersion: c.MinVersion,
  27. MaxVersion: c.MaxVersion,
  28. CurvePreferences: c.CurvePreferences,
  29. DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
  30. Renegotiation: c.Renegotiation,
  31. }
  32. }