Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1714

 TrustStore/KeyStore is not being found in Linux OSs

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • 1.3.12, 1.5.7
    • 1.2.6
    • None
    • None
    •   Ubuntu 20.0.4.4LTS

        Java 11.0.16

        ---------------------

        SLES 15-SP4

        Java 11.0.16

       

    Description

      Gabriel Barreto Juliao created this issue on 30/Dec/22 8:44 PM
         
       When using SSL configuration, Logback cannot find Keystore/Truststore file in the specified path in Linux OS's

        h1. To Reproduce
         # Create an Appender/Receiver that supports SSL
         # Reference the location to your TrustStore/KeyStore
         # Make sure the file exists in the specified location inside your Linux OS
         # Package the application (JAR)
         # Execute the JAR

        h1. Expected behavior

        A file not found "java.security.KeyStoreException" should be thrown.

         
        h1. Observation

        I've debug this inside Intellij. The method Loader.getResourceBySelfClassLoader returns a null value for the URL, which forces the url.openStream(); to throw a FileNotFoundException, which then throws KeyStoreException.

         

      The error happens only in Linux, because in Windows it uses a different flow inside the LocationUtil.urlForResource. it uses SCHEME_PATTERN instead of CLASSPATH_SCHEME. Windows matches CLASSPATH_SCHEME because paths start with "C:"

       

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            ceki Ceki Gülcü
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: