Details
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:"