Skip to content

Instantly share code, notes, and snippets.

@liveinstantly
Last active March 29, 2023 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liveinstantly/c10a780a302badb42b5e5cca7000f9b9 to your computer and use it in GitHub Desktop.
Save liveinstantly/c10a780a302badb42b5e5cca7000f9b9 to your computer and use it in GitHub Desktop.
Wowza Streaming Engine: Generate HTTPS Certificate Java Key Store file (JKS) for Wowza Streaming Engine.
#!/bin/bash
#
# generate_wse_jks.sh
# Wowza Streaming Engine - Generate HTTPS Certificate Java Key Store file (JKS) for Wowza Streaming Engine.
#
# (c) 2023 LiveInstantly, LLC. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
export DOMAIN=your.domain.name
export WMSAPP_HOME="$(readlink /usr/local/WowzaStreamingEngine)"
export WSE_KS_PASSWORD=keystore.passwd
export WSE_P12=${DOMAIN}.p12
export WSE_JKS=${DOMAIN}.jks
if [ ! -f ${WSE_KS_PASSWORD} ]; then
openssl rand -base64 15 > ${WSE_KS_PASSWORD}
fi
export PASS=`cat ${WSE_KS_PASSWORD}`
sudo rm -f ${WSE_P12} ${WSE_JKS}
sudo openssl pkcs12 -export -legacy \
-in /etc/letsencrypt/live/${DOMAIN}/fullchain.pem \
-inkey /etc/letsencrypt/live/${DOMAIN}/privkey.pem \
-out ${WSE_P12} -password pass:${PASS}
sudo ${WMSAPP_HOME}/java/bin/keytool -importkeystore \
-destkeystore ${WSE_JKS} -deststoretype jks -deststorepass ${PASS} \
-srckeystore ${WSE_P12} -srcstoretype pkcs12 -srcstorepass ${PASS}
sudo chown ${USER} ${WSE_P12} ${WSE_JKS}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment