1

I'm using webkit2png to take a screenshot of this website: http://www.ukmt-resources.org.uk/JMC16.html

I received a security error, to which I found the answer was to put --ignore-ssl-check into the code. This only works for some websites, however. I am using the following code in my Mac terminal:

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

Why is it still not granting me permission? I get this instead:

"App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. ... something went wrong: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."

hhhj
  • 13
  • 4
  • Did you try https://forums.developer.apple.com/thread/6205 "App Transport Security and local networking" or https://forums.developer.apple.com/thread/3544 "Application Transport Security ?". Also https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http? – tk421 Sep 05 '17 at 21:16
  • Those seem to focus on apps and info.plist files. I am not using any app, I simply want to gain access to a site from my Mac's terminal so that the webkit2png can do its job. – hhhj Sep 05 '17 at 21:53
  • https://apple.stackexchange.com/questions/210588/how-does-one-configure-a-temporary-exception-to-ats-on-el-capitan-and-fix-webkit suggests hacking webkit2png to insert the disabling of ATS in https://github.com/bendalton/webkit2png/commit/9a96ac8977c386a84edb674ca1518e90452cee88 – tk421 Sep 05 '17 at 22:35

1 Answers1

0

Answer to an old question:

I could work around the error "An SSL error has occurred and a secure connection to the server cannot be made." by installing my self-signed certificate locally.

I followed this guide: 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”

In my case I installed the SSL certificate of my local apache, as defined in the virtual host:

SSLCertificateFile /usr/local/etc/apache2/ssl/apache.pem
Leif
  • 1,076
  • 10
  • 16