Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSL Certificate Checker

A simple, client-side tool to verify SSL certificate installation and check expiration status. Built by Don't Panic Labs.

Features

  • Certificate Expiration - Shows days until expiry with color coding
  • Certificate Authority - Identifies who issued the certificate
  • Domain Coverage - Lists all domains covered by the certificate (SANs)
  • Validity Status - Clear visual indication of certificate status
  • Certificate Chain - Shows the chain of trust
  • TLS Version Detection - Shows TLS 1.2, 1.3, etc. with security rating
  • Signature Algorithm Analysis - RSA vs ECDSA with security recommendations
  • Download Certificate - Download .PEM file for local installation
  • Copy Fingerprint - One-click copy SHA-256 fingerprint for verification
  • Automatic Fallback - Robust error handling with automatic retry mechanisms
  • Collapsible Technical Details - Clean UI with expandable advanced info

Usage

  1. Enter a domain name (e.g., example.com or www.example.com)
  2. Click "Check Certificate"
  3. View certificate details including:
    • Expiration date and countdown
    • Certificate authority (Let's Encrypt, DigiCert, etc.)
    • All covered domains
    • Certificate chain
    • Recommendations

Status Indicators

  • 🟢 VALID - Certificate is valid and has more than 30 days remaining
  • 🟠 EXPIRING SOON - Certificate expires in less than 30 days
  • 🔴 EXPIRED - Certificate has expired

Local Development

Quick Start

For real-time certificate validation:

  1. Start the PHP server:

    cd /Users/jdonner/Workspace/SSLChecker
    php -S localhost:8000
  2. Open in browser:

    open http://localhost:8000/index.html
  3. Test with domains like:

    • google.com
    • github.com
    • malloylawofficesllc.settlementstreams.com
  4. Verify features:

    • ✅ Real-time certificate validation
    • ✅ TLS version detection (in Technical Details)
    • ✅ Download certificate button
    • ✅ Copy fingerprint button
  5. Stop the server when done:

    # Press Ctrl+C in the terminal

Technology Stack

  • Frontend: Vanilla JavaScript (ES6+)
  • Backend: PHP (single file, zero configuration)
  • Styling: Custom CSS matching Don't Panic Labs theme
  • No Build Process: Just HTML, CSS, JavaScript, and one PHP file

File Structure

ssl-checker/
├── index.html                 # Main page
├── css/
│   └── styles.css             # Don't Panic Labs themed styles
├── js/
│   ├── app.js                 # Main application logic
│   ├── api.js                 # Certificate API integration
│   └── certificate-parser.js  # Data formatting
├── assets/
│   └── (logo files)
└── README.md

How It Works

The application uses a simple PHP backend (api/check-cert.php) to:

  1. Connect directly to the domain's SSL/TLS endpoint
  2. Retrieve the certificate and metadata
  3. Parse certificate details (expiration, issuer, SANs, etc.)
  4. Capture TLS version and cipher suite information
  5. Return formatted JSON data to the frontend

No external APIs or third-party services required!

Production Deployment

Option 1: Deploy to dontpaniclabs.com (Recommended)

Prerequisites:

  • SSH access to the server
  • PHP support (✅ dontpaniclabs.com has PHP via WordPress)

Step 1: Prepare Files Locally

cd /Users/jdonner/Workspace/SSLChecker

Step 2: Connect to Server

ssh user@dontpaniclabs.com

Step 3: Create Directory on Server

# Navigate to WordPress directory
cd /var/www/dontpaniclabs.com/public_html

# Create ssl-checker directory
mkdir -p ssl-checker/api
mkdir -p ssl-checker/css
mkdir -p ssl-checker/js
mkdir -p ssl-checker/assets

# Set permissions
chmod 755 ssl-checker

Step 4: Upload Files

Exit SSH and run from your local machine:

# Upload main files
scp index.html user@dontpaniclabs.com:/var/www/dontpaniclabs.com/public_html/ssl-checker/

# Upload CSS
scp css/styles.css user@dontpaniclabs.com:/var/www/dontpaniclabs.com/public_html/ssl-checker/css/

# Upload JavaScript
scp js/*.js user@dontpaniclabs.com:/var/www/dontpaniclabs.com/public_html/ssl-checker/js/

# Upload PHP backend
scp api/check-cert.php user@dontpaniclabs.com:/var/www/dontpaniclabs.com/public_html/ssl-checker/api/

# Upload assets (logo, favicon, etc.)
scp assets/* user@dontpaniclabs.com:/var/www/dontpaniclabs.com/public_html/ssl-checker/assets/

Step 5: Test the Deployment

Visit: https://dontpaniclabs.com/ssl-checker/

Test with a domain like google.com to verify:

  • ✅ Certificate details load correctly
  • ✅ PHP backend is working (check for TLS version in Technical Details)
  • ✅ Download certificate button appears
  • ✅ Copy fingerprint works

Step 6: Troubleshooting

If PHP backend doesn't work:

  1. Check PHP error logs on the server
  2. Verify PHP version: php -v (needs PHP 7.4+)
  3. Check file permissions: ls -la ssl-checker/api/
  4. Check browser console for errors
  5. Verify the PHP file uploaded correctly and is accessible

Option 2: Vercel/Netlify (Serverless)

  1. Push to GitHub repository
  2. Connect repository to Vercel/Netlify
  3. Add environment variables if needed
  4. Deploy (auto-deploys on every push)
  5. Configure custom domain: ssl-checker.dontpaniclabs.com

Note: For Vercel/Netlify, you'll need to convert check-cert.php to a serverless function (Python or Node.js).

Option 3: GitHub Pages (Static Hosting)

  1. Push to GitHub repository
  2. Enable GitHub Pages in repository settings
  3. Access at: https://your-username.github.io/ssl-checker/

Note: GitHub Pages only supports static files (no PHP backend). You would need to use a separate serverless function for certificate checking.

Adding Custom Serverless Function (Optional)

For more accurate current certificate checks, you can add a serverless function:

Create api/check-cert.py (Vercel/Netlify):

import ssl
import socket
import json
from http.server import BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs

class handler(BaseHTTPRequestHandler):
    def do_GET(self):
        query = parse_qs(urlparse(self.path).query)
        domain = query.get('domain', [''])[0]

        if not domain:
            self.send_error(400, 'Domain parameter required')
            return

        try:
            context = ssl.create_default_context()
            with socket.create_connection((domain, 443), timeout=10) as sock:
                with context.wrap_socket(sock, server_hostname=domain) as ssock:
                    cert = ssock.getpeercert()

                    result = {
                        'commonName': dict(x[0] for x in cert['subject'])['commonName'],
                        'issuer': ', '.join([f"{k}={v}" for k, v in cert['issuer'][0]]),
                        'notBefore': cert['notBefore'],
                        'notAfter': cert['notAfter'],
                        'domains': [san[1] for san in cert.get('subjectAltName', [])],
                        'serialNumber': cert.get('serialNumber'),
                        'source': 'direct'
                    }

                    self.send_response(200)
                    self.send_header('Content-type', 'application/json')
                    self.send_header('Access-Control-Allow-Origin', '*')
                    self.end_headers()
                    self.wfile.write(json.dumps(result).encode())

        except Exception as e:
            self.send_error(500, str(e))

Then update js/api.js to use checkViaServerless() method.

Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)
  • Mobile browsers

Styling

Matches Don't Panic Labs branding:

  • Primary Color: #6cb144 (Green)
  • Secondary Color: #becd33 (Lime)
  • Font: Outfit (300, 700 weights)
  • Design: Modern, minimal, responsive

Known Limitations

  1. Requires PHP 7.4+ for the backend to function
  2. Certificate validation is performed at the time of request (not cached)
  3. Some hosting providers may restrict outbound SSL connections

Future Enhancements

  • Side-by-side domain comparison
  • Certificate history timeline
  • Email alerts for expiring certificates
  • Bulk domain checking
  • Export results to PDF

License

© 2024 Don't Panic Labs. All rights reserved.

Support

For issues or questions, contact Don't Panic Labs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages