Files
squid-ssl-bumping-lab/init-ssl.sh
2025-06-14 17:03:07 +02:00

28 lines
680 B
Bash

#!/bin/bash
SSL_DB_DIR="/var/cache/squid/ssl_db"
echo "Checking SSL database..."
# Create the directory if it doesn't exist
if [ ! -d "$SSL_DB_DIR" ]; then
echo "Creating SSL DB directory..."
mkdir -p "$SSL_DB_DIR"
fi
# Ensure permissions are correct
chown -R proxy:proxy "$SSL_DB_DIR"
chmod 755 "$SSL_DB_DIR"
# Check if the SSL database is initialized
if [ ! -d "$SSL_DB_DIR/certs" ]; then
echo "Initializing SSL database..."
cd /var/cache/squid
rm -rf ssl_db
/usr/lib/squid/security_file_certgen -c -s ssl_db -M 4MB
chown -R proxy:proxy ssl_db
echo "SSL database initialized successfully"
else
echo "SSL database already initialized"
fi