You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RTMPS is a secure version of RTMP that uses TLS/SSL to encrypt the data. This is a guide to setting up RTMPS with Red5. An example keystore and truststore creation process will be explained as these files are required for the RTMPS feature. Examples will be provided for both the server and client side which will demonstrate how to use RTMPS and PKCS12 type keystores; JKS keystores can also be used, but are not covered here.
4
4
5
-
## Configuration
5
+
## Keystore and Truststore Creation
6
6
7
-
### Server
7
+
The following commands will create the necessary files for the RTMPS feature. The keystore will contain the server certificate and private key, while the truststore will contain the CA certificate. The client will use the truststore to verify the server certificate. Self-signed certificates are used in this example and are not expected to prevent the client from connecting to the server; in testing, the `ffplay` worked without issue. Examples show sample input for the certificate creation process.
8
8
9
-
On a server where RTMPS will be employed, two files in `conf` must be updated: `red5.properties`and `red5-core.xml`. This is in-addition to the keystore and truststore proceedure.
9
+
* Create our CA key and certificate for self-signing:
10
10
11
-
* In `red5-core.xml` uncomment the beans named `rtmpsMinaIoHandler` and `rtmpsTransport` which may be updated as required, otherwise their values come from the `red5.properties` file. See [Advanced-configuration](#advanced-configuration) for more information.
The following configuration changes are required to enable RTMPS in Red5.
46
171
172
+
### Server
173
+
174
+
On a server where RTMPS will be employed, two files in `conf` must be updated: `red5.properties` and `red5-core.xml`. This is in-addition to the keystore and truststore proceedure.
* In `red5-core.xml` uncomment the beans named `rtmpsMinaIoHandler` and `rtmpsTransport` which may be updated as required, otherwise their values come from the `red5.properties` file.
@@ -72,3 +208,51 @@ Using ffplay issue the following, update for your server IP and stream name as n
72
208
</property>
73
209
</bean>
74
210
```
211
+
212
+
* In `red5.properties`, update these properties to utilize your values; especially for store passwords and locations:
213
+
214
+
```properties
215
+
# RTMPS
216
+
rtmps.host=0.0.0.0
217
+
rtmps.port=8443
218
+
rtmps.ping_interval=5000
219
+
rtmps.max_inactivity=60000
220
+
rtmps.max_keep_alive_requests=-1
221
+
rtmps.max_threads=8
222
+
rtmps.acceptor_thread_count=2
223
+
rtmps.processor_cache=20
224
+
# RTMPS Key and Trust store parameters
225
+
rtmps.keystorepass=password123
226
+
rtmps.keystorefile=conf/rtmps_keystore.p12
227
+
rtmps.truststorepass=password123
228
+
rtmps.truststorefile=conf/rtmps_truststore.p12
229
+
```
230
+
231
+
### Client
232
+
233
+
When connecting to a server that uses RTMPS, the client must have the server's certificate in its truststore. The following example demonstrates how to use the truststore with the Red5 client. Before connecting to the server, the client must set the keystore and truststore paths with password.
234
+
235
+
* Using full paths to the keystore and truststore files:
* When the keystore and truststore are contained within a jar file, use the following format: `jar:file:/path/to/your.jar!/path/to/file/in/jar` for the keystore and truststore paths. This example assumes the jar file which is named `my_rtmps_client.jar` file is contained in a `lib` sub-directory of the application client launch location and the keystore and truststore are in the root:
Using ffplay to test playback, issue the following, but make sure to update the command for your server IP and stream name: `ffplay rtmps://localhost:8443/live/stream1` (this assumes a stream named `stream1` is being published already).
254
+
255
+
### UsefulSystemProperties
256
+
257
+
*To enable SSL debugging, add the following system property to the JVM: `-Djavax.net.debug=SSL`
258
+
*To enable more detailed SSL debugging, add the following system property to the JVM: `-Djavax.net.debug=SSL,handshake,verbose,trustmanager,keymanager,record,plaintext`
0 commit comments