Skip to content

Commit a323d0d

Browse files
Merge branch 'release/v1.1.0'
2 parents 4a70654 + c52249d commit a323d0d

File tree

4 files changed

+63
-34
lines changed

4 files changed

+63
-34
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33

44
# Personal use configuration files.
55
personal-config.ini
6-
personal-ssl-config.bat
6+
personal-ssl-config.bat
7+
personal-ssl-config-restore.bat

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
- Add config option for HTTP/2 per domain.
10+
11+
## [1.1.0] - 2020-06-22
12+
13+
### Added
14+
- Added removal of certificate(s) from Windows store upon 'restore' command.
15+
916
## [1.0.2] - 2020-06-15
1017

1118
### Updated

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ $ start "C:\path\to\ssl_config.bat" "C:\path\to\config.ini" restore
278278
Running the script performs the following:
279279

280280
1. Parses the config file to get required data.
281-
2. Tries to restore the systems 'hosts' file (if a backup is found).
282-
3. Restores each and every installed version of Apache's primary configuration file (if a backup is found).
281+
2. Restores each and every installed version of Apache's primary configuration file (if a backup is found).
282+
3. Removes each and every config domain name from the Windows Trusted Root Certificate Store.
283+
4. Tries to restore the systems 'hosts' file (if a backup is found).
283284

284285
> If your systems 'hosts' file was unable to be restored then see the section titled [Unable To Modify Your Systems 'Hosts' File](#unable-to-modify-your-systems-hosts-file).
285286

ssl_config.bat

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rem INITIALISATION
77
rem -----------------------
88
rem Set default variables
99
rem -----------------------
10-
set $scriptVersion=1.0.2
10+
set $scriptVersion=1.1.0
1111
set $scriptLogFileName=ssl_config.log
1212

1313
rem WampServer sub-paths.
@@ -314,36 +314,6 @@ rem --------------------
314314
rem Check if the restore flag is set to true.
315315
if /i "!$restoreFlag!" equ "true" (
316316

317-
rem Set 'hosts' file updated flag.
318-
set $osHostsFileUpdated=false
319-
320-
rem -------------------------
321-
rem Restore OS 'hosts' file
322-
rem -------------------------
323-
324-
call :logToBoth "Attempting to restore OS 'hosts' file."
325-
326-
rem Check if the OS 'hosts-backup' file exists.
327-
if exist "%$pathToOSHostsFile%-backup" (
328-
329-
rem Restore the OS 'hosts' file.
330-
rem Unable to redirect error output without breaking updating of file...
331-
type "!$pathToOSHostsFile!-backup" > "!$pathToOSHostsFile!" 2>nul
332-
333-
rem Check if the OS 'hosts' file matches the 'hosts-backup'file.
334-
fc "!$pathToOSHostsFile!-backup" "!$pathToOSHostsFile!" >nul && (
335-
set $osHostsFileUpdated=true
336-
call :deleteFileIfExists "!$pathToOSHostsFile!-backup" 2>nul
337-
call :logToBoth "Restored OS 'hosts' file."
338-
) || (
339-
call :logToBoth "Unable to restore OS 'hosts' file."
340-
)
341-
) else (
342-
set $osHostsFileUpdated=true
343-
call :logToBoth "OS 'hosts' backup file not found."
344-
)
345-
346-
347317
rem ------------------------------
348318
rem Loop through Apache versions
349319
rem ------------------------------
@@ -386,6 +356,56 @@ if /i "!$restoreFlag!" equ "true" (
386356
call :logToBoth " '!$installedApacheVersionsArray[%%a]!' validated."
387357
)
388358

359+
360+
rem ----------------------
361+
rem Loop through domains
362+
rem ----------------------
363+
364+
call :logToBoth "Deleting certificates from store:"
365+
366+
rem Iterate through all config listed domains.
367+
for /l %%a in (1,1,%$totalConfigDomains%) do (
368+
369+
rem -----------------------------------
370+
rem Delete cert(s) from Windows store
371+
rem -----------------------------------
372+
373+
rem Delete certificate from 'trusted root certificate store'.
374+
rem View store by entering 'certmgr.msc' at the command line.
375+
certutil -delstore "root" "!$config[%%a][hostname]!" > nul
376+
call :logToBoth " '!$config[%%a][hostname]!'"
377+
)
378+
379+
380+
rem -------------------------
381+
rem Restore OS 'hosts' file
382+
rem -------------------------
383+
384+
rem Set 'hosts' file updated flag.
385+
set $osHostsFileUpdated=false
386+
387+
call :logToBoth "Attempting to restore OS 'hosts' file."
388+
389+
rem Check if the OS 'hosts-backup' file exists.
390+
if exist "%$pathToOSHostsFile%-backup" (
391+
392+
rem Restore the OS 'hosts' file.
393+
rem Unable to redirect error output without breaking updating of file...
394+
type "!$pathToOSHostsFile!-backup" > "!$pathToOSHostsFile!" 2>nul
395+
396+
rem Check if the OS 'hosts' file matches the 'hosts-backup'file.
397+
fc "!$pathToOSHostsFile!-backup" "!$pathToOSHostsFile!" >nul && (
398+
set $osHostsFileUpdated=true
399+
call :deleteFileIfExists "!$pathToOSHostsFile!-backup" 2>nul
400+
call :logToBoth "Restored OS 'hosts' file."
401+
) || (
402+
call :logToBoth "Unable to restore OS 'hosts' file."
403+
)
404+
) else (
405+
set $osHostsFileUpdated=true
406+
call :logToBoth "OS 'hosts' backup file not found."
407+
)
408+
389409
rem ----------------
390410
rem Restart Apache
391411
rem ----------------

0 commit comments

Comments
 (0)