Skip to content

Commit 6015e83

Browse files
Added HTTP/2 functionality
1 parent 407e49c commit 6015e83

File tree

1 file changed

+63
-6
lines changed

1 file changed

+63
-6
lines changed

ssl_config.bat

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ for /l %%a in (1,1,%$totalConfigDomains%) do (
580580
set $config[name]=!$config[%%a][name]!
581581
set $config[hostname]=!$config[%%a][hostname]!
582582
set $config[documentRoot]=!$config[%%a][documentRoot]!
583+
set $config[http2]=!$config[%%a][http2]!
583584

584585
rem Show domain name.
585586
call :logToBoth "---------------------------------------------"
@@ -637,11 +638,19 @@ for /l %%a in (1,1,%$totalConfigDomains%) do (
637638
rem (Re)Create HTTPS vhost file
638639
rem -----------------------------
639640
if not exist "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf" (
640-
(call :apache24HttpsVhostConfigFile) >> "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
641+
if /i "!$config[http2]!" equ "false" (
642+
(call :apache24Https11VhostConfigFile) >> "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
643+
) else (
644+
(call :apache24Https2VhostConfigFile) >> "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
645+
)
641646
call :logToBoth " Created Virtual Host https file."
642647
) else (
643648
call :deleteFileIfExists "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
644-
(call :apache24HttpsVhostConfigFile) >> "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
649+
if /i "!$config[http2]!" equ "false" (
650+
(call :apache24Https11VhostConfigFile) >> "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
651+
) else (
652+
(call :apache24Https2VhostConfigFile) >> "!$config[wampServerExtensionsPath]!\vhosts\https\!$config[hostname]!.conf"
653+
)
645654
call :logToBoth " Re-created Virtual Host https file."
646655
)
647656

@@ -777,11 +786,15 @@ for /l %%a in (1,1,%$totalApacheVersionsInstalled%) do (
777786
call :logToBoth " 'ssl_module' already uncommented."
778787
)
779788

789+
780790
rem -----------------------------------------
781791
rem Uncomment 'http2_module' module
782792
rem
783793
rem This module enables HTTP/2 support.
784794
rem
795+
rem HTTP/2 functionality set per development
796+
rem domain.
797+
rem
785798
rem OpenSSL version must be greater than or
786799
rem equal to 1.0.2 for HTTP/2 compatibility.
787800
rem
@@ -1296,10 +1309,10 @@ echo ^</VirtualHost^>
12961309
exit /B
12971310

12981311

1299-
rem -----------------------------------------------------------
1300-
rem The vhosts 'httpd-ssl.conf' configuration (template) file
1301-
rem -----------------------------------------------------------
1302-
:apache24HttpsVhostConfigFile
1312+
rem ---------------------------------------------------------------------------
1313+
rem The vhosts 'httpd-ssl.conf' configuration (template) file (with HTTP/1.1)
1314+
rem ---------------------------------------------------------------------------
1315+
:apache24Https11VhostConfigFile
13031316

13041317
echo # Virtual Host - https://!$config[hostname]!
13051318
echo #
@@ -1337,6 +1350,50 @@ echo ^</VirtualHost^>
13371350
exit /B
13381351

13391352

1353+
rem -------------------------------------------------------------------------
1354+
rem The vhosts 'httpd-ssl.conf' configuration (template) file (with HTTP/2)
1355+
rem -------------------------------------------------------------------------
1356+
:apache24Https2VhostConfigFile
1357+
1358+
echo # Virtual Host - https://!$config[hostname]!
1359+
echo #
1360+
echo ^<VirtualHost *:443^>
1361+
echo:
1362+
echo ServerName !$config[hostname]!
1363+
echo ServerAlias !$config[hostname]!
1364+
echo ServerAdmin admin@%!$config[hostname]!
1365+
echo DocumentRoot "!$config[documentRoot]!"
1366+
echo:
1367+
echo ^<Directory "!$config[documentRoot]!/"^>
1368+
echo SSLOptions +StdEnvVars
1369+
echo Options +Indexes +Includes +FollowSymLinks +MultiViews
1370+
echo AllowOverride All
1371+
echo Require local
1372+
echo Require ip !$ipNetworkPart!
1373+
echo ^</Directory^>
1374+
echo:
1375+
echo SSLEngine on
1376+
echo:
1377+
echo SSLCertificateFile "!$config[wampServerExtensionsPath]!/certs/!$config[hostname]!/server.crt"
1378+
echo SSLCertificateKeyFile "!$config[wampServerExtensionsPath]!/certs/!$config[hostname]!/private.key"
1379+
echo:
1380+
echo LogFormat "%%L [%%{%%a, %%d-%%b-%%g %%T}t %%{%%z}t] %%H %%m \"%%U%%q\" (%%b bytes) %%>s" access
1381+
echo CustomLog "!$config[wampServerExtensionsPath]!/logs/!$config[hostname]!/access.log" access
1382+
echo:
1383+
echo ErrorLogFormat "%%L [%%t] [%%-m:%%l] [pid %%P:tid %%T] %%E: %%a %%M"
1384+
echo ErrorLog "!$config[wampServerExtensionsPath]!/logs/!$config[hostname]!/error.log"
1385+
echo:
1386+
echo LogFormat "%%L [%%{%%a, %%d-%%b-%%g %%T}t %%{%%z}t] %%H %%{SSL_PROTOCOL}x %%{SSL_CIPHER}x %%m \"%%U%%q\" (%%b bytes) %%>s" ssl
1387+
echo CustomLog "!$config[wampServerExtensionsPath]!/logs/!$config[hostname]!/ssl_request.log" ssl
1388+
echo:
1389+
echo SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
1390+
echo Protocols h2 http/1.1
1391+
echo:
1392+
echo ^</VirtualHost^>
1393+
1394+
exit /B
1395+
1396+
13401397
rem ------------------------------------------
13411398
rem Include SSL in Apache configuration file
13421399
rem ------------------------------------------

0 commit comments

Comments
 (0)