← All posts
SSL certificatevibe codingHTTPSsecuritydeployment

Fix Missing SSL Certificate in Vibe-Coded Apps: Step-by-Step Guide

O

OverMCP Team

Quick answer

To fix a missing SSL certificate in a vibe-coded app, deploy to a platform that provides automatic HTTPS (like Vercel or Netlify) and ensure your DNS records point to the platform. If you use a custom domain, add a CNAME record pointing to your deployment URL—SSL is typically provisioned automatically within minutes. For manual setups, use Let's Encrypt with Certbot or a reverse proxy like Nginx.

Why vibe-coded apps often miss SSL

AI coding tools like Cursor, Bolt.new, and v0 generate frontend and backend code quickly, but they don't configure deployment infrastructure. When you deploy a vibe-coded app, SSL/TLS certificates are usually handled by the hosting platform, not the code itself. Common pitfalls include:

  • Deploying to a bare IP address or a platform that doesn't auto-provision certificates.
  • Using a custom domain without proper DNS configuration.
  • Hardcoding http:// URLs in API calls or redirects, causing mixed content errors.
  • Forgetting to enable HTTPS on serverless functions or databases.
  • What to check first

    Before diving into fixes, verify these basics:

  • Platform auto-SSL: Does your hosting provider (Vercel, Netlify, Render, Railway) automatically issue SSL certificates? Most do for their subdomains.
  • Custom domain DNS: If you own a domain, have you added the required DNS records (CNAME, A, or ALIAS) pointing to your host?
  • Mixed content: Are there any http:// resources (images, scripts, API calls) in your code? Use the browser's DevTools Network tab to check.
  • HTTP to HTTPS redirect: Does your app redirect http:// to https://? Without it, users can still access the insecure version.
  • Certificate validity: Use an SSL certificate checker to confirm the certificate is valid and not expired.
  • Step-by-step fix

    1. Deploy to an auto-SSL platform

    Most modern platforms provide free SSL certificates via Let's Encrypt out of the box. If you haven't deployed yet, choose one of these:

  • Vercel: Automatic SSL for all deployments, including custom domains.
  • Netlify: Automatic SSL for all sites.
  • Render: Free SSL for static sites and web services.
  • Railway: SSL for all public services.
  • Example: Deploying a Next.js app built with Cursor to Vercel:

    # Install Vercel CLI
    npm i -g vercel
    
    # Deploy
    vercel --prod

    Vercel automatically provisions an SSL certificate for your-app.vercel.app.

    2. Add a custom domain

    If you use a custom domain (e.g., myapp.com), add it in your platform's dashboard:

  • Vercel: Go to Project Settings > Domains > Add. You'll get DNS instructions (usually a CNAME record pointing to cname.vercel-dns.com).
  • Netlify: Site settings > Domain management > Add custom domain. Add a CNAME record pointing to your-site.netlify.app.
  • After adding the domain, update your DNS provider (e.g., Cloudflare, Namecheap) with the record. SSL is provisioned automatically within a few minutes.

    3. Force HTTPS in your code

    Even with SSL, your app may still serve insecure content. Add HTTP to HTTPS redirects and use relative URLs or https:// explicitly.

    Next.js (App Router): In next.config.js:

    // next.config.js
    module.exports = {
      async redirects() {
        return [
          {
            source: '/:path*',
            has: [{ type: 'header', key: 'x-forwarded-proto', value: 'http' }],
            destination: 'https://:path*',
            permanent: true,
          },
        ];
      },
    };

    Alternatively, set environment variable NEXT_PUBLIC_SITE_URL to https://yourdomain.com and use it for absolute URLs.

    Node.js/Express:

    // server.js
    app.use((req, res, next) => {
      if (req.headers['x-forwarded-proto'] !== 'https') {
        return res.redirect(301, `https://${req.headers.host}${req.url}`);
      }
      next();
    });

    4. Fix mixed content issues

    AI-generated code often includes hardcoded http:// URLs for API calls, images, or scripts. Search your codebase for "http://" and replace with either:

  • Relative URLs (e.g., /api/data)
  • Protocol-relative URLs (e.g., //api.example.com/data)
  • Environment variables that dynamically set the protocol
  • Example using environment variables in a vibe-coded React app:

    // .env.local
    NEXT_PUBLIC_API_URL=https://api.myapp.com
    
    // component
    fetch(process.env.NEXT_PUBLIC_API_URL + '/data')

    5. Manual SSL (self-hosted or VPS)

    If you're not using a platform with auto-SSL, set up Let's Encrypt manually:

    # Install Certbot (Ubuntu)
    sudo apt update
    sudo apt install certbot python3-certbot-nginx
    
    # Obtain certificate
    sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
    
    # Auto-renewal is usually configured automatically; verify:
    sudo certbot renew --dry-run

    Common mistakes

  • Hardcoding HTTP in API URLs: AI tools often generate http://localhost:3000/api which works locally but fails in production with HTTPS. Always use relative URLs or environment variables.
  • Ignoring mixed content warnings: The browser blocks insecure scripts on HTTPS pages. Check the console for "Mixed Content" errors.
  • Using a custom domain without DNS propagation: SSL provisioning fails if DNS isn't properly configured. Wait up to 48 hours for DNS changes to propagate.
  • Not redirecting HTTP to HTTPS: Users can still access http:// version, which may appear broken or insecure. Implement a redirect.
  • Forgetting internal services: If your vibe-coded app calls a backend API or database, ensure those endpoints also use HTTPS. For example, Supabase provides HTTPS endpoints by default.
  • How OverMCP helps

    Instead of manually checking for SSL issues, use a free AI app security scanner to automatically detect missing certificates, mixed content, and other misconfigurations. OverMCP integrates with your Vercel or GitHub account to continuously monitor your vibe-coded apps—so you never ship without HTTPS again.

    FAQ

    How long does it take for an SSL certificate to be issued after adding a custom domain?

    On platforms like Vercel and Netlify, SSL certificates are typically issued within 1–5 minutes after DNS propagation. DNS changes can take up to 48 hours, but often resolve within minutes.

    Can I use a free SSL certificate for my vibe-coded app?

    Yes. Let's Encrypt provides free certificates, and most hosting platforms (Vercel, Netlify, Render) include them automatically. There's no need to purchase a certificate.

    Why does my vibe-coded app show "Not Secure" in the browser?

    This usually means the page is served over HTTP instead of HTTPS, or there's mixed content (insecure resources loaded on an HTTPS page). Check your URL bar for the protocol and use the browser's DevTools to find insecure requests.

    Is your app secure?

    Free scan in 30 seconds. No signup needed.

    Scan My App Free