Local network tool that transparently redirects all X/Twitter traffic to xcancel.com, allowing you to browse Twitter content without directly accessing X's servers.
This guide uses mkcert - a simple tool that automatically creates and installs a local Certificate Authority, then generates trusted certificates. Much easier than manual OpenSSL!
mkcert advantages:
vs. Manual OpenSSL (see SSL_SETUP.md):
Choose mkcert for simplicity, manual OpenSSL for maximum control.
brew install mkcert
brew install nss # For Firefox support
# Install certutil for Firefox support
sudo apt install libnss3-tools
# Install mkcert
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo mv mkcert-v*-linux-amd64 /usr/local/bin/mkcert
sudo pacman -S mkcert
# Using Chocolatey
choco install mkcert
# Or using Scoop
scoop bucket add extras
scoop install mkcert
Verify installation:
mkcert -version
# Should show: v1.4.4 or later
This is a one-time setup that creates your Certificate Authority and installs it in your system trust store.
# Create local CA and install in system trust store
mkcert -install
Output:
Created a new local CA 💥
The local CA is now installed in the system trust store! ⚡️
The local CA is now installed in the Firefox trust store (requires browser restart)! 🦊
What this does:
~/.local/share/mkcert (Linux) or ~/Library/Application Support/mkcert (macOS)Find your CA files:
# macOS
ls -la ~/Library/Application\ Support/mkcert/
# Linux
ls -la ~/.local/share/mkcert/
# Look for:
# rootCA.pem (CA certificate)
# rootCA-key.pem (CA private key - KEEP SECURE!)
# Generate certificate for all domains
mkcert twitter.com x.com "*.twitter.com" "*.x.com" t.co "*.t.co"
Output:
Created a new certificate valid for the following names 📜
- "twitter.com"
- "x.com"
- "*.twitter.com"
- "*.x.com"
- "t.co"
- "*.t.co"
The certificate is at "./twitter.com+5.pem" and the key at "./twitter.com+5-key.pem" ✅
What you get:
twitter.com+5.pem - Certificate with all SANstwitter.com+5-key.pem - Private keyThe “+5” means 5 additional SANs beyond the first domain.
# Navigate to your xcancel-forwarder directory
cd /path/to/xcancel-forwarder
# Copy certificates to nginx
cp twitter.com+5.pem nginx/ssl/twitter_bundle.pem
cp twitter.com+5-key.pem nginx/ssl/twitter_key.pem
# Set proper permissions
chmod 644 nginx/ssl/twitter_bundle.pem
chmod 600 nginx/ssl/twitter_key.pem
Verify nginx configuration (nginx/conf.d/xcancel-redirect.conf):
ssl_certificate /etc/nginx/ssl/twitter_bundle.pem;
ssl_certificate_key /etc/nginx/ssl/twitter_key.pem;
Restart nginx:
docker compose restart nginx
Your current device (where you ran mkcert) should already trust the certificates.
# Test certificate
openssl s_client -connect twitter.com:443 -servername twitter.com < /dev/null
# Look for:
# Verify return code: 0 (ok)
Browser test:
https://twitter.comFor other devices on your network to trust your certificates, you need to install the CA certificate.
# macOS
CA_CERT=~/Library/Application\ Support/mkcert/rootCA.pem
# Linux
CA_CERT=~/.local/share/mkcert/rootCA.pem
# Copy it somewhere accessible
cp "$CA_CERT" ~/Desktop/mkcert-ca.pem
mkcert-ca.pem to yourself or upload to a web servermkcert-ca.pem to your devicemkcert-ca.pem# Run PowerShell as Administrator
certutil -addstore -f "ROOT" mkcert-ca.pem
# Debian/Ubuntu
sudo cp mkcert-ca.pem /usr/local/share/ca-certificates/mkcert-ca.crt
sudo update-ca-certificates
# Arch/Manjaro
sudo trust anchor --store mkcert-ca.pem
# GUI method
open mkcert-ca.pem
# In Keychain Access, set to "Always Trust"
# Command line
sudo security add-trusted-cert -d -r trustRoot \
-k /Library/Keychains/System.keychain mkcert-ca.pem
If you need to regenerate (e.g., certificate expires or you need different domains):
# Generate new certificate (overwrites existing files)
mkcert twitter.com x.com "*.twitter.com" "*.x.com" t.co "*.t.co"
# Copy to nginx
cp twitter.com+5.pem nginx/ssl/twitter_bundle.pem
cp twitter.com+5-key.pem nginx/ssl/twitter_key.pem
# Restart nginx
docker compose restart nginx
No need to reinstall CA on devices - it stays valid.
mkcert certificates are valid for 825 days (about 2.25 years) by default.
Check expiration:
openssl x509 -in twitter.com+5.pem -noout -dates
Set reminder to regenerate before expiration.
If you want to remove the CA from your system:
# Uninstall CA from system trust store
mkcert -uninstall
# Remove CA files
rm -rf ~/.local/share/mkcert # Linux
rm -rf ~/Library/Application\ Support/mkcert # macOS
You’ll also need to manually remove the CA from any other devices where you installed it.
You’re on a system without GUI access or proper NSS tools.
Solution: Manually install the CA:
# Find CA location
mkcert -CAROOT
# Install manually (see Part 5 above)
# Reinstall CA
mkcert -uninstall
mkcert -install
# Restart browser
# Install NSS tools
# macOS
brew install nss
# Linux
sudo apt install libnss3-tools
# Reinstall mkcert CA
mkcert -install
Each device needs the CA installed independently (see Part 5).
Regenerate with correct domain list:
mkcert twitter.com x.com www.twitter.com www.x.com t.co www.t.co "*.twitter.com" "*.x.com"
mkcert stores your CA private key at:
~/Library/Application Support/mkcert/rootCA-key.pem~/.local/share/mkcert/rootCA-key.pemKEEP THIS SECURE! Anyone with this file can create trusted certificates for any domain on your devices.
Best practices:
The CA only affects devices where you’ve installed it. It cannot intercept traffic on devices you don’t control.
mkcert pros:
mkcert cons:
Use SSL_SETUP.md instead if:
# One-time setup
brew install mkcert
mkcert -install
# Generate certificates
mkcert twitter.com x.com "*.twitter.com" "*.x.com" t.co "*.t.co"
# Install in nginx
cp twitter.com+5.pem nginx/ssl/twitter_bundle.pem
cp twitter.com+5-key.pem nginx/ssl/twitter_key.pem
chmod 644 nginx/ssl/twitter_bundle.pem
chmod 600 nginx/ssl/twitter_key.pem
# Restart nginx
docker compose restart nginx
# Export CA for other devices
cp "$(mkcert -CAROOT)/rootCA.pem" ~/Desktop/mkcert-ca.pem
Done! Much simpler than OpenSSL, and certificates are immediately trusted on your current device.