python - Webkit2png 不适用于 --ignore-ssl-check

标签 python http security

我正在使用 webkit2png 截取该网站的屏幕截图:http://www.ukmt-resources.org.uk/JMC16.html

我收到一个安全错误,我发现答案是将 --ignore-ssl-check 放入代码中。但是,这仅适用于某些网站。 我在我的 Mac 终端中使用以下代码:

webkit2png --ignore-ssl-check -D ~/Desktop http://www.ukmt-resources.org.uk/JMC16.html

为什么它仍然不授予我权限?我得到这个:

“应用程序传输安全已阻止明文 HTTP (http://) 资源加载,因为它不安全。可以通过应用程序的 Info.plist 文件配置临时异常(exception)。 ...出了点问题:无法加载资源,因为应用程序传输安全策略要求使用安全连接。”

最佳答案

老问题的回答:

我可以解决错误“发生 SSL 错误,无法与服务器建立安全连接。”通过在本地安装我的自签名证书。

我遵循了这个指南:https://tosbourn.com/getting-os-x-to-trust-self-signed-ssl-certificates/

  1. Locate where your certificate file is. It is likely to be somewhere near your web server configurations.
  2. Open up Keychain Access. You can get to it from Application/Utilities/Keychain Access.app.
  3. Drag your certificate into Keychain Access.
  4. Go into the Certificates section and locate the certificate you just added
  5. Double click on it, enter the trust section and under “When using this certificate” select “Always Trust”

在我的例子中,我安装了本地 Apache 的 SSL 证书,如虚拟主机中所定义:

SSLCertificateFile /usr/local/etc/apache2/ssl/apache.pem

关于python - Webkit2png 不适用于 --ignore-ssl-check,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46063190/

相关文章:

python - 在 Pandas 数据框中添加可变长度列 Python

python - 在 Linux ec2 上安装 Anaconda 3 后,从 Linux 中卸载一个 Anaconda version2

http - 使用不同的查询字符串缓存图像(S3 签名 url)

AngularJS - 服务器端 index.html 和身份验证

Spring 安全性与 Apache Shiro

python - 使每个数字的值不超过 90

python - 更新 tensorflow 中的张量切片

javascript - 在 Meteor (JavaScript) 中指定内容类型

performance - 处理共享托管计划中的大量图像的最佳方法是什么?

security - 我应该在 Asp.net WebAPI 中的哪里插入授权?