Skip to content

Instantly share code, notes, and snippets.

@jaredhirsch
Created June 19, 2015 21:00
Show Gist options
  • Save jaredhirsch/40b5eda14c82a25e253b to your computer and use it in GitHub Desktop.
Save jaredhirsch/40b5eda14c82a25e253b to your computer and use it in GitHub Desktop.
firefox addon development: getting SSL working locally

I'm working on an addon which includes an iframe served over https. https is needed for WebChannel (chrome to content) communication to work. It's also going to be needed to find and avoid mixed-content warnings as we pull various bits of remote content into that frame.

Setting this all up is medium-unpleasant, as ops tasks go. I want to remember how I did it, so here are some quick notes:

Assuming you're using the built-in Apache2 install on OSX Yosemite, follow these guides:

You can't just click to accept self-signed certs in iframes in FF; the idea is to prevent clickjacking. (See https://bugzil.la/792479 for more.) To work around this, make yourself a certificate authority in your Firefox addon profile:

  • Open up FF
  • Go to Preferences > Advanced > View Certificates > 'Authorities' tab > Import file...
  • In the finder window, command-shift-g lets you specify the path to the cert, probably something like /private/etc/apache2/ssl/localhost.crt.
  • After restarting FF, you'll get a working iframe, not an iframe that shows an Untrusted Connection error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment