Skip to content

Fails to handle ssl.conf on (some?) Ubuntu vivid systems #981

Closed

Description

@pde

sudo venv/bin/letsencrypt -t --debug -vvvvv
...
2015-10-14 19:36:29,059:DEBUG:letsencrypt.plugins.disco:Other error:(PluginEntryPoint#apache): ('There has been an error in parsing the file (%s): %s', u'/etc/apache2/mods-enabled/ssl.conf', u'Syntax error')
...
I'm not sure ssl.conf has been modified on this system. Anyway:
cat /etc/apache2/mods-enabled/ssl.conf

IfModule mod_ssl.c>

        # 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 builtin
        SSLRandomSeed startup file:/dev/urandom 512
        SSLRandomSeed connect builtin
        SSLRandomSeed connect file:/dev/urandom 512

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

        #
        #   Some MIME-types for downloading Certificates and CRLs
        #
        AddType application/x-x509-ca-cert .crt
        AddType application/x-pkcs7-crl .crl

        #   Pass Phrase Dialog:
        #   Configure the pass phrase gathering process.
        #   The filtering dialog program (`builtin' is a internal
        #   terminal dialog) has to provide the pass phrase on stdout.
        SSLPassPhraseDialog  exec:/usr/share/apache2/ask-for-passphrase

        #   Inter-Process Session Cache:
        #   Configure the SSL Session Cache: First the mechanism 
        #   to use and second the expiring timeout (in seconds).
        #   (The mechanism dbm has known memory leaks and should not be used).
        #SSLSessionCache                 dbm:${APACHE_RUN_DIR}/ssl_scache
        SSLSessionCache         shmcb:${APACHE_RUN_DIR}/ssl_scache(512000)
        SSLSessionCacheTimeout  300

        #   Semaphore:
        #   Configure the path to the mutual exclusion semaphore the
        #   SSL engine uses internally for inter-process synchronization. 
        #   (Disabled by default, the global Mutex directive consolidates by default
        #   this)
        #Mutex file:${APACHE_LOCK_DIR}/ssl_mutex ssl-cache


        #   SSL Cipher Suite:
        #   List the ciphers that the client is permitted to negotiate. See the
        #   ciphers(1) man page from the openssl package for list of all available
        #   options.
        #   Enable only secure ciphers:
        SSLCipherSuite HIGH:!aNULL

        # SSL server cipher order preference:
        # Use server priorities for cipher algorithm choice.
        # Clients may prefer lower grade encryption.  You should enable this
        # option if you want to enforce stronger encryption, and can afford
        # the CPU cost, and did not override SSLCipherSuite in a way that puts
        # insecure ciphers first.
        # Default: Off
        #SSLHonorCipherOrder on

        #   The protocols to enable.
        #   Available values: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2
        #   SSL v2  is no longer supported
        SSLProtocol all -SSLv3

        #   Allow insecure renegotiation with clients which do not yet support the
        #   secure renegotiation protocol. Default: Off
        #SSLInsecureRenegotiation on

        #   Whether to forbid non-SNI clients to access name based virtual hosts.
        #   Default: Off
        #SSLStrictSNIVHostCheck On

</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Activity

  1. added this to the 1.0 for launch milestone on Oct 15, 2015
  2. jdkasten commented on Oct 15, 2015

    @jdkasten
    Contributor

    @pde You are missing a < before IfModule.... it should be <IfModule mod_ssl.c>

  3. jdkasten commented on Oct 15, 2015

    @jdkasten
    Contributor

    ^ Was this a copy and paste error?

  4. jdkasten commented on Oct 15, 2015

    @jdkasten
    Contributor

    I haven't tested this out... but if Apache is that relaxed in its handling of configuration files. (Which at this point wouldn't completely surprise me) I think we can probably make the bug report more helpful, by trying to detect what went wrong, but I don't think we should try to autocorrect these errors at this time.

  5. pde commented on Oct 15, 2015

    @pde
    MemberAuthor

    Sorry, that is a copy and paste error. Re-pasting from this system:

    <IfModule mod_ssl.c>
    
            # 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 builtin
            SSLRandomSeed startup file:/dev/urandom 512
            SSLRandomSeed connect builtin
            SSLRandomSeed connect file:/dev/urandom 512
    
            ##
            ##  SSL Global Context
            ##
            ##  All SSL configuration in this context applies both to
            ##  the main server and all SSL-enabled virtual hosts.
            ##
    
            #
            #   Some MIME-types for downloading Certificates and CRLs
            #
            AddType application/x-x509-ca-cert .crt
            AddType application/x-pkcs7-crl .crl
    
            #   Pass Phrase Dialog:
            #   Configure the pass phrase gathering process.
            #   The filtering dialog program (`builtin' is a internal
            #   terminal dialog) has to provide the pass phrase on stdout.
            SSLPassPhraseDialog  exec:/usr/share/apache2/ask-for-passphrase
    
            #   Inter-Process Session Cache:
            #   Configure the SSL Session Cache: First the mechanism 
            #   to use and second the expiring timeout (in seconds).
            #   (The mechanism dbm has known memory leaks and should not be used).
            #SSLSessionCache                 dbm:${APACHE_RUN_DIR}/ssl_scache
            SSLSessionCache         shmcb:${APACHE_RUN_DIR}/ssl_scache(512000)
            SSLSessionCacheTimeout  300
    
            #   Semaphore:
            #   Configure the path to the mutual exclusion semaphore the
            #   SSL engine uses internally for inter-process synchronization. 
            #   (Disabled by default, the global Mutex directive consolidates by default
            #   this)
            #Mutex file:${APACHE_LOCK_DIR}/ssl_mutex ssl-cache
    
    
            #   SSL Cipher Suite:
            #   List the ciphers that the client is permitted to negotiate. See the
            #   ciphers(1) man page from the openssl package for list of all available
            #   options.
            #   Enable only secure ciphers:
            SSLCipherSuite HIGH:!aNULL
    
            # SSL server cipher order preference:
            # Use server priorities for cipher algorithm choice.
            # Clients may prefer lower grade encryption.  You should enable this
            # option if you want to enforce stronger encryption, and can afford
            # the CPU cost, and did not override SSLCipherSuite in a way that puts
            # insecure ciphers first.
            # Default: Off
            #SSLHonorCipherOrder on
    
            #   The protocols to enable.
            #   Available values: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2
            #   SSL v2  is no longer supported
            SSLProtocol all -SSLv3
    
            #   Allow insecure renegotiation with clients which do not yet support the
            #   secure renegotiation protocol. Default: Off
            #SSLInsecureRenegotiation on
    
            #   Whether to forbid non-SNI clients to access name based virtual hosts.
            #   Default: Off
            #SSLStrictSNIVHostCheck On
    
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  6. jdkasten commented on Oct 15, 2015

    @jdkasten
    Contributor

    Related issue: hercules-team/augeas#191

    This is a problem with the Httpd lens in Augeas 1.3 -- (I wasn't seeing the problem as I was personally running 1.2). The problem has been resolved in Augeas 1.4

    The problem arises when comments are left at the end. For letsencrypt-apache, we might want to disallow Augeas 1.3 as this will certainly be a frequent problem.

    The other alternative is not to hard-fail on parsing issues. The client would have still successfully run on the other files in this case and it wouldn't have affected the end result. This would complicate tracking down other bugs later.

  7. pde commented on Oct 15, 2015

    @pde
    MemberAuthor

    There are likely to be a lot of OSes out there that have this bug, unpatched. Fedora seems to have gone to 1.4 but Ubuntu doesn't have a ticket for this problem.

    I presume there's no way for us to work around the issue by feeding in files with the trailing line stripped off?

  8. pde commented on Oct 15, 2015

    @pde
    MemberAuthor

    Or shipping the lense from 1.4 ourselves? They're just text files, right?

  9. pde commented on Oct 21, 2015

    @pde
    MemberAuthor

    Apparently we can pass lenses in.

  10. erebus2 commented on Oct 22, 2015

    @erebus2

    +1
    (sorry have to do this because of isaacs/github#283)

  11. erebus2 commented on Oct 22, 2015

    @erebus2

    I think that shipping our own lens would just be a work-around that should be avoided if possible. IMO, the right thing to do would be to depend on augeas-lenses v1.4. This would force distros to fix their augeas packages before they can ship letsencrypt.

    See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802665

  12. jdkasten commented on Oct 22, 2015

    @jdkasten
    Contributor
  13. pde commented on Oct 23, 2015

    @pde
    MemberAuthor

    @erebus2 agree it's a workaround, but our primary aim for the time being is to get people working copies of the letsencrypt client, not to persuade distributions to fix old buggy packages. IME the latter can be a painful and thankless task...

  14. 8 remaining items

  15. erebus2 commented on Oct 29, 2015

    @erebus2

    @SwartzCr Well, I just don't like it because it's a workaround and not an actual fix.

    However, due to #1202, we might have to ship our own lens anyway.

  16. SwartzCr commented on Oct 29, 2015

    @SwartzCr
    Contributor

    do we have a lens we want to use or should I just load the httpd lens from Augaes 1.2?

  17. erebus2 commented on Oct 29, 2015

    @erebus2

    No, the lens from 1.2 is broken as well. On my machine, it incorrectly detects a syntax error in /etc/nagios/apache2.conf

  18. SwartzCr commented on Oct 29, 2015

    @SwartzCr
    Contributor

    do we have a working lens?

  19. pde commented on Oct 30, 2015

    @pde
    MemberAuthor

    If we don't, then the best option is to take then lens from 1.4 and start fixing bugs in it :(

  20. SwartzCr commented on Nov 2, 2015

    @SwartzCr
    Contributor

    does anyone have a link to the httpd.lns file from v1.4? All I can find in the tarball is httpd.aug, and for various reasons I can't find a good place to install it to try to rip the lens file from /augeas/load/Httpd/lens

  21. pde commented on Nov 2, 2015

    @pde
    MemberAuthor

    I believe the .aug files might actually be the lenses? At least those are the files contained in the augeas-lenses debian package...

  22. domcleal commented on Nov 3, 2015

    @domcleal
    Contributor

    The .aug file is the lens, the .lns extension is kind of an internal reference. The file httpd.aug provides the lens Httpd.lns.

    If you want to load it in preference to the one in your distribution package, install it to /usr/share/augeas/lenses/, or put it in a directory and then set the environment variable AUGEAS_LENS_LIB. The dir can also be passed as the second argument to the Augeas constructor (augeas.Augeas(loadpath="/example")).

  23. SwartzCr commented on Nov 4, 2015

    @SwartzCr
    Contributor

    @domcleal do you have a sense if python augeas will support loadpaths for augeas 1.0? We're finding that Travis is failing for this change because the travis machine runs ubunut 12 which has augeas 1.0

  24. domcleal commented on Nov 5, 2015

    @domcleal
    Contributor

    @SwartzCr should be fine, it's had the functionality for years

  25. pde commented on Nov 6, 2015

    @pde
    MemberAuthor

    Closed by #1291! Great work @SwartzCr, @kuba and @ArchimedesPi !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions