Skip to content

Commit

Permalink
Merge pull request #495 from dOpensource/v0.72
Browse files Browse the repository at this point in the history
V0.72
  • Loading branch information
mackhendricks committed Apr 1, 2023
2 parents 963de70 + 3ed9e2a commit 3fc9e0d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion gui/modules/api/api_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

sys.path.insert(0, '/etc/dsiprouter/gui')

import os, time, random, subprocess, requests, csv, base64, codecs, re
import os, time, random, subprocess, requests, csv, base64, codecs, re, socket
from contextlib import closing
from datetime import datetime
from flask import Blueprint, jsonify, request, send_file
Expand Down Expand Up @@ -3000,6 +3000,8 @@ def createCertificate():

# Process Request
domain = request_payload['domain']
if domain == "default":
domain = socket.gethostname()
ip = request_payload['ip'] if 'ip' in request_payload else settings.EXTERNAL_IP_ADDR
port = request_payload['port'] if 'port' in request_payload else 5061
server_name_mode = request_payload['server_name_mode'] \
Expand Down
2 changes: 1 addition & 1 deletion gui/templates/stirshaken.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h4>STIR/SHAKEN Settings</h4>
<input class="form-control " type="text" id="stir_shaken_cert_url"
name="stir_shaken_cert_url"
placeholder="Certificate URL"
value="{{ STIR_SHAKEN_CERT_URL }}">
value="{{ settings.STIR_SHAKEN_CERT_URL }}">
</div>

<div class="form-group">
Expand Down
11 changes: 9 additions & 2 deletions resources/stir_shaken/generate_self_signed_cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

apt -y install openssl coreutils

TMP_CERT_DIR=/tmp/stir-shaken-ca
DSIP_CERT_DIR=/etc/dsiprouter/certs/stirshaken

# Generate Root Certificate Private Key
mkdir /tmp/stir-shaken-ca
cd /tmp/stir-shaken-ca
mkdir $TMP_CERT_DIR
cd $TMP_CERT_DIR
openssl ecparam -noout -name prime256v1 -genkey -out ca-key.pem


Expand Down Expand Up @@ -50,3 +53,7 @@ openssl x509 -req -in sp-csr.pem -CA ../stir-shaken-ca/ca-cert.pem -CAkey ../sti

# verify that the SP certificate contains the TNAuthList extension
openssl x509 -in sp-cert.pem -text -noout

# Copy Key and Certificate to /opt/dsiprouter
cp $TMP_CERT_DIR/sp-cert.pem $DSIP_CERT_DIR
cp $TMP_CERT_DIR/sp-key.pem $DSIP_CERT_DIR

0 comments on commit 3fc9e0d

Please sign in to comment.