No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

README.md 3.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. * Ubuntu (18.04) :
  33. ```
  34. apt-get update
  35. apt-get install build-essential docker docker.io golang patch python python-pip rsync sudo
  36. pip install setuptools
  37. pip install docker
  38. sudo usermod -a -G docker $USER
  39. ```
  40. Similar dependencies can be found on any UNIX based system/distribution.
  41. ### Building
  42. 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``.
  43. ```
  44. git clone https://github.com/cloudflare/tls-tris.git
  45. cd tls-tris; cp _dev/utils/pre-commit .git/hooks/
  46. make -f _dev/Makefile build-all
  47. ```
  48. ### Testing
  49. We run 3 kinds of test:.
  50. * Unit testing: <br/>``make -f _dev/Makefile test-unit``
  51. * Testing against BoringSSL test suite: <br/>``make -f _dev/Makefile test-bogo``
  52. * Compatibility testing (see below):<br/>``make -f _dev/Makefile test-compat``
  53. To run all the tests in one go use:
  54. ```
  55. make -f _dev/Makefile test
  56. ```
  57. ### Testing interoperability with 3rd party libraries
  58. In order to ensure compatibility we are testing our implementation against BoringSSL, NSS and PicoTLS.
  59. Makefile has a specific target for testing interoperability with external libraries. Following command can be used in order to run such test:
  60. ```
  61. make -f _dev/Makefile test-interop
  62. ```
  63. 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.
  64. Script can be started from command line directly. For example:
  65. ```
  66. > ./interop_test_runner -v InteropServer_NSS.test_zero_rtt
  67. test_zero_rtt (__main__.InteropServer_NSS) ... ok
  68. ----------------------------------------------------------------------
  69. Ran 1 test in 8.765s
  70. OK
  71. ```
  72. ### Debugging
  73. 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.