简体   繁体   English

Facebook 链接分享问题

[英]Facebook Link Sharing Issue

I have a single "share to facebook" link on my site using Django Social Share.我使用 Django Social Share 在我的网站上有一个“分享到 facebook”链接。 The issue is that the link being posted to Facebook isn't being scraped - the image, the description, and the title are not populating.问题是发布到 Facebook 的链接没有被抓取——图片、描述和标题没有填充。 All OG meta tags are present and correct, so I checked the Facebook Sharing Debugger and it shows the following error:所有 OG 元标记都存在且正确,因此我检查了Facebook 共享调试器,它显示以下错误:

SSL Error
Can't validate SSL Certificate. Either it is self-signed (which will cause browser warnings) or it is invalid.
Curl Error
Curl error: 60 (SSL_CACERT)

The site's SSL cert is perfectly valid - no errors or warnings at all.该站点的 SSL 证书完全有效 - 根本没有错误或警告。 I'm using LetsEncrypt on Apache with a Django app behind it through WSGI.我在 Apache 上使用 LetsEncrypt,并通过 WSGI 在它后面使用 Django 应用程序。 No issues with any other social networks.任何其他社交网络都没有问题。

An example of one of the links giving this error: https://www.netizen.net/news/post/2643/netizen-ranks-184-on-the-2020-inc-5000-list给出此错误的链接之一的示例: https : //www.netizen.net/news/post/2643/netizen-ranks-184-on-the-2020-inc-5000-list

As you can see if you visit the page, there are no SSL errors.正如您在访问该页面时所看到的那样,没有 SSL 错误。 The same link is scraped just as expected on LinkedIn, Twitter, and elsewhere but FB seems to have this issue.同样的链接在 LinkedIn、Twitter 和其他地方正如预期的那样被刮掉,但 FB 似乎有这个问题。

So, after going back in forth in the comments I found the solution based on guidance from CBroe .因此,在评论中反复讨论之后,我根据CBroe 的指导找到了解决方案。 In short, Let's Encrypt doesn't automatically include the SSLCertificateChainFile in the "standard" Apache configuration it performs, so it needs to be added manually.简而言之,Let's Encrypt 不会在它执行的“标准”Apache 配置中自动包含SSLCertificateChainFile ,因此需要手动添加。 Once I did that, the links started sharing as expected on Facebook.一旦我这样做了,链接就开始按预期在 Facebook 上共享。

However, it only seemed to work properly using the chain.pem file as the chain file and NOT the fullchain.pem which includes extraneous certificate(s).然而,这似乎只是工作使用正确chain.pem文件作为链文件,而不是fullchain.pem ,其中包括多余的证书(或多个)。 Once I configured Apache as below, rebooted Apache, and ran the SSL check, it started working:一旦我按如下方式配置了 Apache,重新启动了 Apache,并运行了 SSL 检查,它就开始工作了:

...
SSLCertificateChainFile /etc/letsencrypt/live/mydomain.com/chain.pem
...

Now, the SSL certificate passes ALL checks and has an "A" rating and is trusted in all devices/platforms because the correct chain file is included:现在,SSL 证书通过所有检查并获得“A”评级,并且在所有设备/平台中都受到信任,因为包含正确的链文件:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM