doc.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Package transport implements functions for facilitating proper TLS-secured
  2. // communications for clients and servers.
  3. //
  4. // Clients should build an identity (of the core.identity) type, such as
  5. //
  6. // var id = &core.Identity{
  7. // Request: &csr.CertificateRequest{
  8. // CN: "localhost test certificate",
  9. // },
  10. // Profiles: map[string]map[string]string{
  11. // "paths": map[string]string{
  12. // "private_key": "client.key",
  13. // "certificate": "client.pem",
  14. // },
  15. // "cfssl": {
  16. // "label": "",
  17. // "profile": "client-ca",
  18. // "remote": "ca.example.net",
  19. // "auth-type": "standard",
  20. // "auth-key": "000102030405060708090a0b0c0d0e0f",
  21. // },
  22. // },
  23. // }
  24. //
  25. //
  26. //
  27. // The New function will return a transport built using the
  28. // NewKeyProvider and NewCA functions. These functions may be changed
  29. // by other packages to provide common key provider and CA
  30. // configurations. Clients can then use RefreshKeys (or launch
  31. // AutoUpdate in a goroutine) to ensure the certificate and key are
  32. // loaded and correct. The Listen and Dial functions then provide the
  33. // necessary connection support.
  34. //
  35. // The AutoUpdate function will handle automatic certificate
  36. // issuance. Servers and clients are not required to take any special
  37. // action when the certificate is updated: the key and certificate are
  38. // only used when establishing a connection, and therefore existing
  39. // connections are not affected---there is no need to reset or restart
  40. // any existing connections. Clients should run AutoUpdate if they
  41. // plan on making multiple connections or will be reconnecting; for a
  42. // one-off connection, it isn't necessary.
  43. package transport