You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "maruixiang (via GitHub)" <gi...@apache.org> on 2025/05/12 06:50:16 UTC

[I] setKeystoreFile for a resource file in class path [mina-ftpserver]

maruixiang opened a new issue, #78:
URL: https://github.com/apache/mina-ftpserver/issues/78

   org.apache.ftpserver.ssl.SslConfigurationFactory#loadStore support   file or resource.
   
   but  org.apache.ftpserver.ssl.SslConfigurationFactory#setKeystoreFile  only  support   file , it will check file length:
   
    public void setKeystoreFile(File keyStoreFile) {
           if (keyStoreFile != null && keyStoreFile.length() != 0L) {
               this.keystoreFile = keyStoreFile;
           } else {
               throw new FtpServerConfigurationException("KeystoreFile must not be null or zero length");
           }
       }
   
   resolve this is to remove the check :
    public void setKeystoreFile(File keyStoreFile) {
           
               this.keystoreFile = keyStoreFile;
         
       }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] setKeystoreFile for a resource file in class path [mina-ftpserver]

Posted by "elecharny (via GitHub)" <gi...@apache.org>.
elecharny commented on issue #78:
URL: https://github.com/apache/mina-ftpserver/issues/78#issuecomment-2871233860

   It's a bit more complicated. If you never call {{setKeystoreFile}}, the {{keystoreFile}} class variable is set to {{./res/.keystore}}, its default value. If it does not exist, then the {{loadStore}} method will try to load it from the classpath.
   
   AFAICT, sounds good to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org