Google SEO Advanced

HTTPS for Your Own Site: SSL Certificates, HSTS, and Mixed Content Fixes

Installing an SSL certificate gets you only 30% of the way to HTTPS. A proper setup has to clear three hurdles: use a free Let's Encrypt ECDSA certificate with 90-day auto-renewal and an alert at 15 days remaining; ...

独立站HTTPS配置:证书、HSTS与混合内容三层检查HTTPS hardening: certs, HSTS and mixed-content in three layers 证书装了不等于HTTPS合格 —— HSTS不加、混合内容不洗完,浏览器照样打红色警告A cert alone is not HTTPS-ready — without HSTS and mixed-content cleanup the browser still flags it 层Layer 关键动作Key action 量化门槛Quantitative bar 1 证书1. Cert ECDSA P-256 · 90天自动续期ECDSA P-256, 90-day auto-renew 剩余有效期 ≥ 15 天告警Alert if ≤ 15 days left 2 HSTS2. HSTS max-age ≥ 31536000 · 预加载max-age ≥ 31536000, preload 先 5 分钟观察再升 1 年Start 5 min, ramp to 1 year 3 混合内容3. Mixed content 自动升级 · CSP升级Upgrade-insecure-requests 反直觉判断:HSTS不是加得越快越好,第一次直接上一年期会把测试环境锁死Counter-intuitive: ramping HSTS too hard locks your staging out for a year 正确节奏:先 max-age=300 跑 1 周,再升到 86400 跑 1 个月,最后才上 31536000 + preloadRamp 300s for 1 week, 86400s for 1 month, then 31536000 + preload 红线:HTTP 80端口必须 301 跳 HTTPS,不能保留可访问的 HTTP 页面Red line: port 80 must 301 to HTTPS — no reachable HTTP pages left 否则搜索引擎会把 http 和 https 当成两份内容,分散权重并触发重复内容判定Otherwise search engines split signals across two versions and flag duplicates 验收:SSL Labs 评级 A 以上 · 浏览器地址栏无警告 · 全站 mixed content 0 条Pass criteria: SSL Labs A+ · no browser warnings · zero mixed-content hits 每月跑一次 SSL Server Test,证书到期前 15 天必须有人收到告警Re-run SSL Server Test monthly; alert 15 days before expiry
Three-Part HTTPS Check: Auto-Renewed Certificates, Gradual HSTS Upgrade, Automatic Mixed Content Cleanup

HTTPS for Your Own Site: SSL Certificates, HSTS, and Mixed Content Fixes

Bottom line first: Installing an SSL certificate gets you only 30% of the way to HTTPS. A proper setup has to clear three hurdles: use a free Let’s Encrypt ECDSA certificate with 90-day auto-renewal and an alert at 15 days remaining; upgrade HSTS in three stages, from 300 seconds to 86400 seconds to 31536000 seconds, and only then add preload; upgrade mixed content automatically with the CSP upgrade-insecure-requests header, then manually clear the hardcoded http:// left in <img>, <script>, and inline styles. You only pass once SSL Labs gives you an A or better.

1. Choosing a Certificate and Auto-Renewal: Skip OV Certificates and Never Renew by Hand

Many site owners buy a paid SSL certificate the first year, forget to renew it the second, and get hit with a red browser warning. The counterintuitive conclusion: for the vast majority of B2B sites, a free Let’s Encrypt DV certificate is more than enough. You still get OCSP stapling and an A+ rating, and the company name that a paid OV certificate adds has no measurable effect on conversion.

Only two hard requirements matter when choosing a certificate. First, the key algorithm: pick ECDSA P-256 over RSA 2048. The handshake is 40% smaller and the first load on mobile is about 80 milliseconds faster. Second, the renewal method: you must use certbot or acme.sh for auto-renewal, with crontab checking once a day. Never renew by hand. In 90% of certificate expiration incidents, the person responsible left the company or simply forgot.

Certificate Type Annual cost Browser Display Best for Recommendation
Let’s Encrypt DV ECDSA Free Padlock, no company name Most B2B sites Default choice, auto-renewal
Let’s Encrypt DV RSA Free Padlock, no company name Legacy device compatibility Only if you have IE11 traffic
Paid OV certificate 2,000-8,000 yuan/year Green company name Finance, payments, high-ticket Don’t buy unless required
Paid EV certificate 5,000-20,000 yuan/year EV badge (removed by most browsers) Almost no use case Not recommended

Example: a SaaS company in Hangzhou going global uses acme.sh to request a Let’s Encrypt certificate, with crontab set to 0 3 * * 1 /root/.acme.sh/acme.sh –renew -d example.com, checking and renewing automatically at 3 a.m. every Monday. Add a monitoring rule at the same time: alert via WeCom when the certificate has less than 15 days left. Set this up once and you won’t touch it again for two years.

How to handle multiple domains and wildcards, and CDN global acceleration node certificate strategy should be planned together. CDN providers usually supply edge certificates, and origin and edge certificates should be managed separately. Don’t let edge certificate renewal depend on the origin.

2. HSTS: Upgrade Gradually, Not All at Once

HSTS (HTTP Strict Transport Security) is the response header that forces browsers to use HTTPS. What’s counterintuitive is this: the longer you set max-age, the safer it is, but also the more dangerous. If you set max-age=31536000 right out of the gate, your test environment, staging subdomains, and internal admin panel will be unable to use HTTP for a year, and if the certificate ever has a problem, the whole site goes down.

The right upgrade pace has three stages: week one, max-age=300 (5 minutes), and watch for user complaints and business anomalies; weeks two through four, max-age=86400 (1 day), and confirm nothing is wrong; only after a month do you move up to max-age=31536000 (1 year) and add includeSubDomains. Submitting to the preload list should come even later; wait until it has run stably for 3 months before submitting to the chromium preload.

Stage How to write the HSTS header Observation window Risk Points
Tier 1 Strict-Transport-Security: max-age=300 1 week Almost no risk, can roll back at any time
Tier 2 max-age=86400 1 month Some older browsers may not be compatible
Tier 3 max-age=31536000; includeSubDomains 3 months All subdomains must be HTTPS-ready
Final stage Add the preload directive and submit to hstspreload.org Long term Extremely costly to remove after submission

Example scenario: an industrial equipment exporter’s site has HTTPS on the main domain example.com, but legacy.example.com is still HTTP. Turning on includeSubDomains right away would lock out users of the legacy subdomain. The right approach is to first make all subdomains HTTPS, then gradually push the main site’s HSTS to a one-year term. You can see the subdomain list in the SSL Labs test report.

HSTS and Compliance foundation for global sites the transport security requirements in it are consistent: GDPR’s encryption requirement for personal data transmission is most directly implemented technically by HSTS.

3. Mixed content: automatic upgrade plus manual cleanup, two steps

Mixed content means resources loaded over the http:// protocol on an HTTPS page. There are two types: passive mixed content (images, videos, fonts), which browsers automatically block without an error; and active mixed content (

FAQ

Is a free Let's Encrypt certificate enough, or should I buy a paid OV one?
For the vast majority of B2B standalone sites, it's more than enough. Let's Encrypt provides free 90-day DV certificates, supports ECDSA and RSA, renews automatically with zero maintenance, and can also reach an A or A+ SSL Labs rating. The extra company name in the browser address bar from a paid OV certificate produces no measurable lift in conversion for B2B buyers. Only finance, payments, and high-ticket scenarios with compliance requirements need to consider OV. EV certificates no longer show the company name in Chrome and Firefox, so there's even less reason to buy one.
Can I set max-age=31536000 for HSTS the first time?
No, that's the most common configuration mistake. Setting a one-year max-age right away forces HTTPS on all your subdomains, staging environments, and admin panels for a full year. If the certificate has problems or a subdomain isn't HTTPS-ready, every user on your site gets locked out. The right rollout is max-age=300 for a week, then 86400 for a month, and only then 31536000 with includeSubDomains. Submitting to the preload list comes even later, after three months of stability.
How do I fix mixed content in bulk? Is there a one-click tool?
Two steps. First, add the response header Content-Security-Policy: upgrade-insecure-requests. The browser will automatically rewrite http:// resources in the page to https://, which solves 80% of the problem. Second, run through the whole site with the Chrome DevTools console and clear the remaining hardcoded http:// references out of your code and database. On WordPress, don't run a direct SQL replace on wp_posts. Use the Search Replace DB tool for a serialization-safe replace. After fixing, verify with both SSL Labs and the Chrome console to confirm zero mixed content.
How do I set up automatic certificate renewal, and what are the worst pitfalls?
Use certbot or acme.sh with crontab for automatic renewal, running a check once a week. The most common pitfall is that the webroot used by the renewal script doesn't match the actual nginx configuration, so validation fails and the certificate quietly expires. After configuring, immediately run the renewal command manually once to confirm it works, and add a monitoring rule: alert when the certificate has less than 15 days of validity left. If Cloudflare sits in front as a CDN, note that the edge certificate and the origin certificate are two separate sets. Don't renew only one.
Does HTTPS affect SEO? Do I need HTTPS site-wide?
Yes, it affects SEO, and yes, it's required. Google has used HTTPS as a ranking signal since 2018, and Chrome flags HTTP sites as not secure. More importantly, search engines treat HTTP and HTTPS as two versions of the same content, which splits authority and can trigger duplicate content penalties. The right approach is to 301 all HTTP port 80 traffic to HTTPS and not keep any accessible HTTP pages. For the 301 handoff method when changing domains or migrating, see Site rebuilds and domain changes this article.
How should I configure TLS versions? Should I disable TLS 1.0 and 1.1?
Yes, you must disable them. TLS 1.0 and 1.1 were formally deprecated by RFC 8996, and PCI DSS compliance requirements and mainstream browsers are phasing out support. In your nginx configuration, keep only TLSv1.2 and TLSv1.3, and prefer ECDHE and AES-GCM cipher suites. After configuring, run an SSL Server Test to confirm a grade of A or above and that TLS 1.0 and 1.1 are absent from the protocol list. If you have traffic from very old IE11 users, you can handle compatibility for that user agent separately. Don't enable old protocols site-wide.

Final thoughts

People treat HTTPS setup as a one-and-done certificate install, but it's actually the foundation of both site security and SEO. Expired certificates, missing HSTS, and leftover mixed content each trigger a red browser warning, and buyers close the page the moment they see one. Your SEO rankings take a hit too. Set it up once, audit it monthly. The cost is low, and the payoff is visible across your entire site.

Three steps to get there: first, clear the certificate hurdle with Let's Encrypt auto-renewal and get an A or better on SSL Labs. Then raise HSTS through three stages, from a 5-minute max-age up to one year. Finally, cut mixed content to zero using upgrade-insecure-requests plus manual cleanup. Only after these three steps is HTTPS truly configured. For the ongoing maintenance checklist, see Six Monthly Tasks for Site Maintenance, and add the HTTPS audit to it.

One line worth remembering: HTTPS isn't done once you install a certificate. Auto-renewal, gradual HSTS upgrades, and zero mixed content, all three layers cleared, is what real HTTPS means. Miss one layer, and the browser's red warning will drive your buyers away for you.

Crater
Crater Crater experts

Official Organization · Crater

Crater is a go-global services company specializing in WordPress standalone site development + Google SEO + GEO full-funnel growth, serving sectors including smart hardware, industrial equipment, SaaS, and new energy.

Product CapabilitiesMethodology WhitepaperIndustry Report
965articles shared
78knowledge base articles