Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 981ea0c

Browse files
author
Christian Korneck
committed
Merge branch 'dev'
2 parents 7389f0d + 879070e commit 981ea0c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The release download includes a build of the NSS `certutil.exe`.
1616
Usage
1717
-------------
1818
- download and extract the ZIP file from the [release page](https://github.com/christian-korneck/firefox_add-certs/releases) (includes the NSS certutil.exe binaries)
19-
- put all CA certificates that you want to add in the folder: `cacert\`
19+
- put all CA certificates that you want to add in the folder: `cacert\`. File extension needs to be `.pem`.
2020
- note: For testing, the CA folder includes the [CACert.org](http://www.cacert.org/) root and intermediate certificates. Remove them if you don't want to add them.
2121
- run `add-certs.cmd` with admin privileges
2222

add-certs.cmd

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
@echo off
1+
@if /i "%1" NEQ "-verbose" @echo off
22
setlocal
33

44
REM #### general config
5-
if not defined programfiles(x86) set programfiles(x86)=%programfiles%
6-
set firefoxdefaultprofile=%programfiles(x86)%\Mozilla Firefox\browser\defaults\Profile
7-
5+
set programFilesWithMozilla=%programfiles%
6+
if not exist "%programFilesWithMozilla%\Mozilla Firefox" set programFilesWithMozilla=%programfiles(x86)%
7+
if not exist "%programFilesWithMozilla%\Mozilla Firefox" exit /B 1
88

99
REM #### default firefox profile
10-
if not exist "%programfiles(x86)%\Mozilla Firefox" exit /B 1
10+
set firefoxdefaultprofile=%programFilesWithMozilla%\Mozilla Firefox\browser\defaults\Profile
1111
if not exist "%firefoxdefaultprofile%" mkdir "%firefoxdefaultprofile%"
1212
if not exist "%firefoxdefaultprofile%\cert8.db" copy /y "%~dp0db\empty\cert8.db" "%firefoxdefaultprofile%\" >NUL
1313
if not exist "%firefoxdefaultprofile%\key3.db" copy /y "%~dp0db\empty\key3.db" "%firefoxdefaultprofile%\" >NUL
@@ -39,10 +39,13 @@ set certfile=!certpath:%replacepath%=!
3939
set certfile=!certfile:.pem=!
4040
set certfile=!certfile:.cacert=!
4141
set certfile=AddedByUser !certfile!
42-
FOR /D %%P IN ("%%U\AppData\Roaming\Mozilla\Firefox\Profiles\*") DO "%~dp0bin\certutil.exe" -A -n "!certfile!" -i "%%C" -t "cTC,cTC,cTC", -d "%%P"
42+
FOR /D %%P IN ("%%U\AppData\Roaming\Mozilla\Firefox\Profiles\*") DO (
43+
"%~dp0bin\certutil.exe" -A -n "!certfile!" -i "%%C" -t "cTC,cTC,cTC", -d "%%P"
44+
)
4345
))
4446
setlocal DISABLEDELAYEDEXPANSION
4547

48+
REM ####Current user
4649
setlocal ENABLEDELAYEDEXPANSION
4750
set replacepath=%~dp0cacert\
4851
FOR /R "%~dp0" %%C IN (cacert\*.pem) DO (

0 commit comments

Comments
 (0)