Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ```
  2. _____ _ ____ _ _
  3. |_ _| | / ___| | |_ _ __(_)___
  4. | | | | \___ \ _____| __| '__| / __|
  5. | | | |___ ___) |_____| |_| | | \__ \
  6. |_| |_____|____/ \__|_| |_|___/
  7. ```
  8. crypto/tls, now with 100% more 1.3.
  9. THE API IS NOT STABLE AND DOCUMENTATION IS NOT GUARANTEED.
  10. [![Build Status](https://travis-ci.org/cloudflare/tls-tris.svg?branch=master)](https://travis-ci.org/cloudflare/tls-tris)
  11. ## Usage
  12. Since `crypto/tls` is very deeply (and not that elegantly) coupled with the Go stdlib,
  13. tls-tris shouldn't be used as an external package. It is also impossible to vendor it
  14. as `crypto/tls` because stdlib packages would import the standard one and mismatch.
  15. So, to build with tls-tris, you need to use a custom GOROOT.
  16. A script is provided that will take care of it for you: `./_dev/go.sh`.
  17. Just use that instead of the `go` tool.
  18. The script also transparently fetches the custom Cloudflare Go 1.10 compiler with the required backports.
  19. ## Development
  20. ### Dependencies
  21. Copy paste line bellow to install all required dependencies:
  22. * ArchLinux:
  23. ```
  24. pacman -S go docker gcc git make patch python2 python-docker rsync
  25. ```
  26. * Debian:
  27. ```
  28. apt-get install build-essential docker go patch python python-pip rsync
  29. pip install setuptools
  30. pip install docker
  31. ```
  32. Similar dependencies can be found on any UNIX based system/distribution.
  33. ### Building
  34. There are number of things that need to be setup before running tests. Most important step is to copy ``go env GOROOT`` directory to ``_dev`` and swap TLS implementation and recompile GO. Then for testing we use go implementation from ``_dev/GOROOT``.
  35. ```
  36. make -f _dev/Makefile build-all
  37. ```
  38. ### Testing
  39. We run 3 kinds of test:.
  40. * Unit testing: <br/>``make -f _dev/Makefile test-unit``
  41. * Testing against BoringSSL test suite: <br/>``make -f _dev/Makefile test-bogo``
  42. * Compatibility testing (see below):<br/>``make -f _dev/Makefile test-compat``
  43. To run all the tests in one go use:
  44. ```
  45. make -f _dev/Makefile test
  46. ```
  47. ### Testing interoperability with 3rd party libraries
  48. In order to ensure compatibility we are testing our implementation against BoringSSL, NSS and PicoTLS.
  49. Makefile has a specific target for testing interoperability with external libraries. Following command can be used in order to run such test:
  50. ```
  51. make -f _dev/Makefile test-interop
  52. ```
  53. The makefile target is just a wrapper and it executes ``_dev/interop_test_runner`` script written in python. The script implements interoperability tests using ``python unittest`` framework.
  54. Script can be started from command line directly. For example:
  55. ```
  56. > ./interop_test_runner -v InteropServer_NSS.test_zero_rtt
  57. test_zero_rtt (__main__.InteropServer_NSS) ... ok
  58. ----------------------------------------------------------------------
  59. Ran 1 test in 8.765s
  60. OK
  61. ```
  62. ### Debugging
  63. When the environment variable `TLSDEBUG` is set to `error`, Tris will print a hexdump of the Client Hello and a stack trace if an handshake error occurs. If the value is `short`, only the error and the first meaningful stack frame are printed.