Commit Graph

5 Commits

Author SHA1 Message Date
Terry Wilson
225da545c5 Corret spelling and example
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-05 16:05:50 +00:00
Terry Wilson
10317dacb6 Tell people to use the correct common name for clients as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-05 15:36:20 +00:00
Terry Wilson
739dcea39b Don't create directories without at least o+x
Also, making files that you are going to modify read-only is dumb.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 22:35:29 +00:00
Terry Wilson
af6a9e6199 Make files readable only by the owner
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 22:18:36 +00:00
Terry Wilson
177d65f59c Add TLS cert helper script
This script is useful for quickly generating self-signed CA, server, and client
certificates for use with Asterisk. It is still recommended to obtain
certificates from a recognized Certificate Authority and to develop an
understanding how SSL certificates work. Real security is hard work.

OPTIONS:
  -h  Show this message
  -m  Type of cert "client" or "server". Defaults to server.
  -f  Config filename (openssl config file format)
  -c  CA cert filename (creates new CA cert/key as ca.crt/ca.key if not passed)
  -k  CA key filename
  -C  Common name (cert field)
        For a server cert, this should be the same address that clients
        attempt to connect to. Usually this will be the Fully Qualified
        Domain Name, but might be the IP of the server. For a CA or client
        cert, it is merely informational. Make sure your certs have unique
        common names.
  -O  Org name (cert field)
        An informational string (company name)
  -o  Output filename base (defaults to asterisk) 
  -d  Output directory (defaults to the current directory)

Example:

To create a CA and a server (pbx.mycompany.com) cert with output in /tmp:
  ast_tls_cert -C pbx.mycompany.com -O "My Company" -d /tmp

This will create a CA cert and key as well as asterisk.pem and the the two
files that it is made from: asterisk.crt and asterisk.key. Copy asterisk.pem
and ca.crt somewhere (like /etc/asterisk) and set tlscertfile=/etc/asterisk.pem
and tlscafile=/etc/ca.crt. Since this is a self-signed key, many devices will
require you to import the ca.crt file as a trusted cert.

To create a client cert using the CA cert created by the example above:
  ast_tls_cert -m client -c /tmp/ca.crt -k /tmp/ca.key -C "Joe User" -O \
    "My Company" -d /tmp -o joe_user

This will create client.crt/key/pem in /tmp. Use this if your device supports
a client certificate. Make sure that you have the ca.crt file set up as
a tlscafile in the necessary Asterisk configs. Make backups of all .key files
in case you need them later.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 16:49:34 +00:00