iPhoto2Gallery: “Could not connect to the gallery” when using SSL

Today I decided to force SSL access to my gallery2 installation when uploading photos with iPhoto2Gallery. This involved several steps (informed by the iPhoto2Gallery FAQ):

1. Make sure you can access your gallery2 installation via SSL (webserver config mostly assumed for the purposes of this post, though setting baseUri in gallery2/config.php to include https:// is also useful).
2. Make sure regular http access to your gallery2 installation is disabled:

I added the following to the relevant VirtualHost tag in my apache config file (e.g., sites-enabled/000-default in Debian / Ubuntu):

# Prevent non-SSL access to content in /var/www/gallery2
<directorymatch “^/var/www/gallery2/”>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Don’t forget to restart your web server. (sudo /etc/init.d/apache2 restart).

3. If you’re using a self-signed certificate, you must add it to OS X’s key manager. I clicked the lock icon in the bottom right of Firefox while connected to my site via SSL and selected “export” to export the certificate. Save it somewhere with a .crt extension. Double-click it to load the OS X keychain manager. It should import successfully. One must then edit its “Trust” settings and “Always Allow” SSL.

At this point iPhoto2Gallery worked as expected, connecting only via SSL. Note that I did have to delete my existing entry in iPhoto2Gallery and add a new one, this time including https:// in the URL and selecting the “Use SSL” checkbox.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s