Score:0

Can't enable ssl on windows apache24

ec flag

So, i've already sucessfully installed ssl certificates in apache virtual hosts (2 websites) but i'm unable to access them because every time I activate SSL in httpd.conf apache service wont start

</IfModule>

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Here it is my httpd-ssl.conf

#
# This is the Apache server configuration file providing SSL support.
# It contains the configuration directives to instruct the server how to
# serve pages over an https connection. For detailed information about these 
# directives see <URL:http://httpd.apache.org/docs/2.4/mod/mod_ssl.html>
# 
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Required modules: mod_log_config, mod_setenvif, mod_ssl,
#          socache_shmcb_module (for default value of SSLSessionCache)

#
# Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the SSL library.
# The seed data should be of good random quality.
# WARNING! On some platforms /dev/random blocks if not enough entropy
# is available. This means you then cannot use the /dev/random device
# because it would lead to very long connection times (as long as
# it requires to make more entropy available). But usually those
# platforms additionally provide a /dev/urandom device which doesn't
# block. So, if available, use this one instead. Read the mod_ssl User
# Manual for more details.
#
#SSLRandomSeed startup file:/dev/random  512
#SSLRandomSeed startup file:/dev/urandom 512
#SSLRandomSeed connect file:/dev/random  512
#SSLRandomSeed connect file:/dev/urandom 512


#
# When we also provide SSL we have to listen to the 
# standard HTTP port (see above) and to the HTTPS port
#
Listen 443

##
##  SSL Global Context
##
##  All SSL configuration in this context applies both to
##  the main server and all SSL-enabled virtual hosts.
##

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate,
#   and that httpd will negotiate as the client of a proxied server.
#   See the OpenSSL documentation for a complete list of ciphers, and
#   ensure these follow appropriate best practices for this deployment.
#   httpd 2.2.30, 2.4.13 and later force-disable aNULL, eNULL and EXP ciphers,
#   while OpenSSL disabled these by default in 0.9.8zf/1.0.0r/1.0.1m/1.0.2a.
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES

#  By the end of 2016, only TLSv1.2 ciphers should remain in use.
#  Older ciphers should be disallowed as soon as possible, while the
#  kRSA ciphers do not offer forward secrecy.  These changes inhibit
#  older clients (such as IE6 SP2 or IE8 on Windows XP, or other legacy
#  non-browser tooling) from successfully connecting.  
#
#  To restrict mod_ssl to use only TLSv1.2 ciphers, and disable
#  those protocols which do not support forward secrecy, replace
#  the SSLCipherSuite and SSLProxyCipherSuite directives above with
#  the following two directives, as soon as practical.
# SSLCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA
# SSLProxyCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA

#   User agents such as web browsers are not configured for the user's
#   own preference of either security or performance, therefore this
#   must be the prerogative of the web server administrator who manages
#   cpu load versus confidentiality, so enforce the server's cipher order.
SSLHonorCipherOrder on 

#   SSL Protocol support:
#   List the protocol versions which clients are allowed to connect with.
#   Disable SSLv3 by default (cf. RFC 7525 3.1.1).  TLSv1 (1.0) should be
#   disabled as quickly as practical.  By the end of 2016, only the TLSv1.2
#   protocol or later should remain in use.
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is an internal
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog  builtin

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         "dbm:${SRVROOT}/logs/ssl_scache"
SSLSessionCache        "shmcb:${SRVROOT}/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300

#   OCSP Stapling (requires OpenSSL 0.9.8h or later)
#
#   This feature is disabled by default and requires at least
#   the two directives SSLUseStapling and SSLStaplingCache.
#   Refer to the documentation on OCSP Stapling in the SSL/TLS
#   How-To for more information.
#
#   Enable stapling for all SSL-enabled servers:
#SSLUseStapling On

#   Define a relatively small cache for OCSP Stapling using
#   the same mechanism that is used for the SSL session cache
#   above.  If stapling is used with more than a few certificates,
#   the size may need to be increased.  (AH01929 will be logged.)
#SSLStaplingCache "shmcb:${SRVROOT}/logs/ssl_stapling(32768)"

#   Seconds before valid OCSP responses are expired from the cache
#SSLStaplingStandardCacheTimeout 3600

#   Seconds before invalid OCSP responses are expired from the cache
#SSLStaplingErrorCacheTimeout 600

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>
ServerAdmin [email protected]
DocumentRoot "${SRVROOT}/htdocs\sim-tek.pt"
ServerName www.sim-tek.pt
ErrorLog "${SRVROOT}/error"
SSLEngine on
SSLCertificateFile "${SRVROOT}/conf/certificate.crt"
SSLCertificateKeyFile "${SRVROOT}/conf/private.key"
SSLCertificateChainFile "${SRVROOT}/conf/ca_bundle.key"

</VirtualHost>                                  

Error

Error logs:

[Thu Apr 06 16:27:25.234801 2023] [mpm_winnt:notice] [pid 7788:tid 348] AH00424: Parent: Received restart signal -- Restarting the server.
[Thu Apr 06 16:27:25.324886 2023] [ssl:warn] [pid 7788:tid 348] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Apr 06 16:27:25.324886 2023] [mpm_winnt:notice] [pid 7788:tid 348] AH00455: Apache/2.4.54 (Win64) PHP/8.1.12 OpenSSL/1.1.1p configured -- resuming normal operations
[Thu Apr 06 16:27:25.324886 2023] [mpm_winnt:notice] [pid 7788:tid 348] AH00456: Apache Lounge VS16 Server built: Jun 22 2022 09:58:15
[Thu Apr 06 16:27:25.324886 2023] [core:notice] [pid 7788:tid 348] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Thu Apr 06 16:27:25.340511 2023] [mpm_winnt:notice] [pid 7788:tid 348] AH00418: Parent: Created child process 7540
[Thu Apr 06 16:27:26.031068 2023] [ssl:warn] [pid 7540:tid 400] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Apr 06 16:27:26.246554 2023] [mpm_winnt:notice] [pid 7540:tid 400] AH00354: Child: Starting 64 worker threads.
[Thu Apr 06 16:27:27.267773 2023] [mpm_winnt:notice] [pid 2612:tid 380] AH00364: Child: All worker threads have exited.
[Thu Apr 06 16:27:40.303948 2023] [mpm_winnt:notice] [pid 7788:tid 348] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Thu Apr 06 16:28:10.312585 2023] [mpm_winnt:notice] [pid 7788:tid 348] AH00431: Parent: Forcing termination of child process 7540
vidarlo avatar
ar flag
When Apache fails to start it gives you an error message. What is that error message?
totabank avatar
ec flag
@vidarlo "The requested operation has failed!" , is there any debug option i could activate to deep understand the problem?
vidarlo avatar
ar flag
*Which* operation? You claim Apache fails to start. When Apache fails to start, it outputs an error message that tells you the reason for why it failed. This typically is printed to stdout, and may end up in logs depending on your configuration. You have to provide the content of those logs.
totabank avatar
ec flag
error logs updated in the post @vidarlo
jp flag
Did you **read** the eror log? It also gives a hint: `Session Cache is not configured [hint: SSLSessionCache]`.
totabank avatar
ec flag
I've tried to enable sslsessioncache but it didn't resolve my problem
totabank avatar
ec flag
help @vidarlo .
vidarlo avatar
ar flag
My guess is that Apache spits out some error message to stdout that is not written to errorlog. You'll have to figure out how to read that message in your enviroment. I've never touched Apache on Windows.
Merlin8771 avatar
in flag
Looks like you are missing some modules. I.E. they are not loading or you have not added the or uncommented them. There are a few that you need to add/ uncomment for it to work. mod_authn_socache.so, mod_cache.so, mod_cache_socache.so, there are a few more I think but can't recall at the moment.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.