Make sure that the bin folder of your JRE installation is added to your PATH environment variable. If the PATH variable is configured correctly, you should be able to open a command prompt and execute the command keytool. This will return the command reference for the keytool command. After you have the keytool command up-and-running, do the following to create a self-signed SSL certificate:
- Open a command prompt and change the directory to [install-dir]/conf.
- Execute the following command: keytool -genkey -alias wowza -keyalg
keytool -genkey -keysize 2048 -alias wowza -keyalg RSA -keystore ssl.mycompany.com.jks
- You'll be prompted to answer several questions. The following sample responses assume that the certificate is tied to the domain name ssl.mycompany.com:
[Enter keystore password] password [What is your first and last name] ssl.mycompany.com [What is the name of your organizational unit] Web Department [What is the name of your organization] My Company Name [What is the name of your City or Locality] Evergreen [What is the name of your State or Province] Colorado [What is the two-letter country code for this unit] US [Enter key password for <password>] password
You'll see a certificate file named ssl.mycompany.com.jks in the [install-dir]/conf folder. To configure a TCP port to use this certificate, open the [install-dir]/conf/VHost.xml file in a text editor and make the following changes:
- Uncomment the <HostPort> definition for port 443. This entry follows the comment <!-- 443 with SSL -->. Be sure to remove the comment before <HostPort> and after </HostPort>.
- Set the SSLConfig/KeyStorePath value to:
- Set the SSLConfig/KeyStorePassword value to the key password entered above.
TCP port 443 is now protected by SSL and RTMPS. You must configure a domain name entry for the domain chosen above and all communications that use port 443 must use either SSL or RTMPS and the domain name specified in the certificate.
The above steps must be followed on any computer that uses RTMPS to play a stream that's protected with a self-signed certificate. It's better to get a signed certificate from Wowza or from another trusted certificate authority. With a trusted certificate, the above steps aren't required. For more information about how to get a signed certificate from a certificate authority, see How to request an SSL certificate from a certificate authority.
Note: Self-signed certificates don't work on OS X when using Adobe Flash Player to stream over RTMPS without first installing the certificate in the Keychain and setting its trust level to Always Trust. To extract the certificate and install in the OS X Keychain, do the following:
- Extract the certificate from the keystore using the following command, and then copy the ssl.mycompany.com.crt file to the Mac:
keytool -export -alias wowza -file ssl.mycompany.com.crt -keystore ssl.mycompany.com.jks
- Open the Keychain Access utility (Applications > Utilities > Keychain Access).
- Under Keychains, select a keychain, and then under Category, select the Certificates category.
- Drag-and-drop the ssl.mycompany.com.crt onto the Keychain Access utility.
- Right-click ssl.mycompany.com in the list, and then select Get Info.
- In the dialog box that displays the certificate information, in the Trust area, set the When using this certificate option to Always Trust.
Note: There are two RTMPS streaming methods when using the Adobe Flash player. The default method leverages tunneling (RTMPT over SSL), which can be slow and cause additional server load. The second method is RTMP over SSL, which performs better. You can enable this mode by setting the NetConnection.proxyType to "best" before calling NetConnection.connect. For example:
var nc:NetConnection = new NetConnection(); nc.proxyType = "best"; nc.connect("rtmps://ssl.mycompany.com/myapplication");
Note: For troubleshooting information about SSL certificates and the configuration of Wowza media servers to use SSL certificates, see How to troubleshoot SSL certificate configuration.
Originally Published: 10-09-2012.
If you're having problems or want to discuss this article, post in our forum.