secure_dtls_client_cert.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. #
  3. # This is an example of a script to run a "secure" TURN DTLS client
  4. # with the long-term credentials mechanism and with certificate check.
  5. #
  6. # Options:
  7. #
  8. # 1) -t is absent, it means that UDP networking is used.
  9. # 2) -S means "SSL protocol with default encryption"
  10. # 3) -i sets certificate file for TLS. -R sets certificate check mode.
  11. # -E sets CA file for certificate check.
  12. # 4) -k sets private key file for TLS.
  13. # 5) -n 1000 means 1000 messages per single emulated client. Messages
  14. # are sent with interval of 20 milliseconds, to emulate an RTP stream.
  15. # 6) -m 10 means that 10 clients are emulated.
  16. # 7) -l 170 means that the payload size of the packets is 170 bytes
  17. # (like average audio RTP packet).
  18. # 8) -e 127.0.0.1 means that the clients will use peer IPv4 address 127.0.0.1.
  19. # 9) -g means "set DONT_FRAGMENT parameter in TURN requests".
  20. # 10) -u bolt means that if the server challenges the client with
  21. # authentication challenge, then we use account "bolt".
  22. # 11) -w kwyjibo sets the password for the account.
  23. # 12) -s option means that the client will be using "send" mechanism for data.
  24. # 13) 127.0.0.1 (the last parameter) is the TURN Server IP address.
  25. # We use IPv6 - to - IPv4 here to illustrate how the TURN Server
  26. # converts the traffic from IPv6 to IPv4 and back.
  27. #
  28. if [ -d examples ] ; then
  29. cd examples
  30. fi
  31. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/
  32. PATH=examples/bin/:../bin:./bin/:${PATH} turnutils_uclient -S -i turn_server_cert.pem -k turn_server_pkey.pem -E turn_server_cert.pem -n 1000 -m 10 -l 170 -e 127.0.0.1 -g -u bolt -w kwyjibo -s -X $@ 127.0.0.1