Replace ssl-cert snakeoil dependency with custom newcert script - #66
Merged
Conversation
…tificate Co-authored-by: ohanssen <2892992+ohanssen@users.noreply.github.com>
Co-authored-by: ohanssen <2892992+ohanssen@users.noreply.github.com>
Copilot
AI
changed the title
Replace snakeoil ssl-cert with newcert script for self-signed TLS certificate
Replace ssl-cert snakeoil dependency with custom newcert script
Aug 8, 2026
Copilot created this pull request from a session on behalf of
ohanssen
August 8, 2026 16:55
View session
Co-authored-by: ohanssen <2892992+ohanssen@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Replaces the Debian package’s reliance on ssl-cert snakeoil certs by introducing a dedicated newcert generator and wiring Apache + postinst to use /etc/polaric/ssl/polaric.{crt,key}.
Changes:
- Add
/usr/sbin/newcertscript to generate and install a self-signed TLS cert/key under/etc/polaric/ssl/. - Update Apache SSL vhost config to use the new Polaric cert/key paths.
- Update packaging to run
newcerton install and dropssl-certfrom dependencies.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| debian/misc/newcert | New certificate-generation script for Polaric’s Apache frontend |
| debian/misc/aprs_ssl.conf | Points Apache SSL cert/key directives to /etc/polaric/ssl/polaric.{crt,key} |
| debian/postinst | Runs newcert during install when cert is missing |
| debian/control | Removes ssl-cert dependency |
| debian/polaric-webapp2.install | Installs newcert into usr/sbin |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+25
to
+27
| if [[ ! -f "/etc/polaric/ssl/polaric.crt" ]]; then | ||
| /usr/sbin/newcert | ||
| fi |
Comment on lines
+29
to
+34
| CALLSIGN=$(grep -i '^\s*mycall\s*=' "$APRSD_CONF" 2>/dev/null \ | ||
| | head -1 \ | ||
| | sed 's/.*=\s*//' \ | ||
| | tr -d '[:space:]' \ | ||
| | tr 'A-Z' 'a-z' \ | ||
| | sed 's/-[0-9]*$//') |
| # /etc/polaric/ssl/polaric.key (private key) | ||
| # | ||
|
|
||
| set -e |
Comment on lines
+55
to
+57
| mkdir -p "$CERT_DIR" | ||
| chmod 750 "$CERT_DIR" | ||
|
|
| chmod 640 "$KEY_FILE" | ||
| chmod 644 "$CERT_FILE" | ||
|
|
||
| # Ensure www-data (Apache) can read the key |
Comment on lines
+60
to
+66
| openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-384 -sha256 -days 3650 \ | ||
| -noenc \ | ||
| -keyout "$KEY_FILE" \ | ||
| -out "$CERT_FILE" \ | ||
| -subj "/CN=$CN" \ | ||
| -addext "subjectAltName=DNS:$CN" \ | ||
| 2>/dev/null |
Comment on lines
+58
to
+60
| # ---- Generate EC private key and self-signed certificate ---- | ||
| # Uses NIST P-384 (secp384r1) elliptic curve. | ||
| openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-384 -sha256 -days 3650 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The package previously depended on
ssl-certsolely for its snakeoil self-signed certificate. This replaces that with anewcertscript that generates a purpose-built cert, optionally embeddingpolaric-<callsign>as the CN/SAN when the aprsd backend is configured.Changes
debian/misc/newcert— New script (/usr/sbin/newcert):mycallfrom/etc/polaric-aprsd/server.ini, strips SSID suffix, lowercases →polaric-la7ecahostname -fif no callsign found[a-z0-9.-]before passing to openssl/etc/polaric/ssl/, key ownedroot:ssl-certdebian/misc/aprs_ssl.conf—SSLCertificateFile/SSLCertificateKeyFileupdated to/etc/polaric/ssl/polaric.{crt,key}debian/postinst— Callsnewcerton first install if cert absentdebian/control— Dropsssl-certfromDepends;opensslwas already listeddebian/polaric-webapp2.install— Addsnewcert→usr/sbin