I have completely given up on trying to use CCK2 to configure Firefox. The directions are vague and the author admits that it doesn't work with the Mac version any more. The major problem is that we have company CAs that are already imported into the System Keychain but Firefox is deliberately built to NOT read that System Keychain (there are many threads about this on mozilla forums and bug reports). Manually importing all the certs is NOT an option. I needed to automate this. I did a lot of research and found that if I import any certs or CA certs into Firefox on my Mac and then copy the cert8.db file to a user on another machine, that will work. The problem is trying to push the file to the target location because of the random folder name of the Firefox profiles across computers. I ended up putting a copy of the cert8.db file (with 777 permissions via Composer) into /Users/Shared/ and then wrote a script to copy it to the current user's firefox profile folder. The hard part was working out how to fit a wildcard into the command. Here's the script I use:
#!/bin/sh
# this script relies on a copy of cert8.db that has the full company cert supply in it to
# be placed in /Users/Shared/ then it copies to the logged in user's firefox profile.
#variable for storing the current users name
currentuser=`stat -f "%Su" /dev/console`
# must quit Firefox before replacing the file or else the data inside the file will be overwritten.
pkill firefox
# it doesn't do any good to try and copy a file to a location that doesn't exist and relies on random naming.
# I had to specify /bin/cp because apparently Apple aliases cp to "cp -i" and that changes the way it works?
if [ -e /Users/$currentuser/Library/Application Support/Firefox/Profiles/ ]
then
/bin/cp -fv /Users/Shared/cert8.db /Users/$currentuser/Library/Application Support/Firefox/Profiles/*/
fi
# deletes the source file when done.
rm /Users/Shared/cert8.db
So far the script works from Self Service, but I have seen if a user has multiple folders within their Profiles folder, it only copies to 1 of them and not the other. I'm just glad Safari and Chrome know to use the certs from the Keychain.


