1
0

secure_relay_cert.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. #
  3. # This is an example how to start a TURN Server in
  4. # secure mode (when authentication is used) - see option -a
  5. # that means "use long-term credential mechanism".
  6. #
  7. # This script shows how to use certificate check option.
  8. #
  9. # We start here a TURN Server listening on IPv4 address
  10. # 127.0.0.1 and on IPv6 address ::1. We use 127.0.0.1 as
  11. # IPv4 relay address, and we use ::1 as IPv6 relay address.
  12. #
  13. # Other options:
  14. #
  15. # 1) set bandwidth limit on client session 3000000 bytes per second (--max-bps).
  16. # 2) use fingerprints (-f)
  17. # 3) use 10 relay threads (-m 10)
  18. # 4) use min UDP relay port 32355 and max UDP relay port 65535
  19. # 5) "-r bolt.co" means "use authentication realm 'bolt.co'"
  20. # 6) "--user=ninefingers:youhavetoberealistic" means "allow user
  21. # 'ninefinger' with password 'youhavetoberealistic'.".
  22. # 7) "--user=bolt:kwyjibo" means "allow user 'bolt' with password 'kwyjibo' ".
  23. # 8) "--cert=..." sets the OpenSSL certificate file name.
  24. # 9) "--pkey=..." sets the OpenSSL private key name.
  25. # 10) --CA-file sets the CA file for client certificate check.
  26. # 11) "--log-file=stdout" means that all log output will go to the stdout.
  27. # 12) "-v" means normal verbose mode (with some moderate logging).
  28. # 13) --cipher-list="ALL:!eNULL:!aNULL:!NULL" measn "all ciphers, except anonymous".
  29. # 14) --cli-password=secret means that cli password set to "secret"
  30. # Other parameters (config file name, etc) are default.
  31. if [ -d examples ] ; then
  32. cd examples
  33. fi
  34. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  35. export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  36. PATH="./bin/:../bin/:../../bin/:${PATH}" turnserver --syslog -a -L 127.0.0.1 -L ::1 -E 127.0.0.1 -E ::1 --allow-loopback-peers --max-bps=3000000 -f -m 10 --min-port=32355 --max-port=65535 --user=ninefingers:youhavetoberealistic --user=bolt:kwyjibo -r bolt.co --cert=turn_server_cert.pem --pkey=turn_server_pkey.pem --CA-file=cacert.pem --log-file=stdout -v --cipher-list="ALL:!eNULL:!aNULL:!NULL" --cli-password=secret --db=var/db/turndb $@