gomonp commented on issue #69:
URL: https://github.com/apache/mina-ftpserver/issues/69#issuecomment-2721811288

   Looks like link to my comment does not work, here is explanation.
   
   Place of the issue - 
core/src/main/java/org/apache/ftpserver/command/impl/**AUTH**.java - constant 
**VALID_AUTH_TYPES**
   
https://github.com/apache/mina-ftpserver/blob/3f2f833a64d64fba508eb7f39519896723a16484/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
   
   Was:
   ```
   private static final List<String> VALID_AUTH_TYPES = Arrays.asList("SSL", 
"TLS", "TLS-C", "TLS-P");
   ```
   Now:
   ```
   // put constant values instead of references, for clarity
   private static final List<String> VALID_AUTH_TYPES = Arrays.asList("SSL", 
"TLS", "TLS_C", "TLS_P");
   ```
   because constants has underscores instead of dashes.
   
   So, for valid client auth type **TLS-P** [following code 
block](https://github.com/apache/mina-ftpserver/blob/3f2f833a64d64fba508eb7f39519896723a16484/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java#L125)
 fails with 502 Command is not supported.
   ```
   if (VALID_AUTH_TYPES.contains(authType)) {
       if (authType.equals(TLS_C_TYPE)) {
           authType = TLS_TYPE;
       } else if (authType.equals(TLS_P_TYPE)) {
           authType = SSL_TYPE;
       }
   
       try {
           LocalizedFtpReply reply = LocalizedFtpReply.translate(session, 
request, context, 234,
               "AUTH." + authType, null);
           secureSession(session, authType, reply);
   
           session.write(reply);
       } catch (FtpException ex) {
           throw ex;
       } catch (Exception ex) {
           LOG.warn("AUTH.execute()", ex);
           throw new FtpException("AUTH.execute()", ex);
       }
   } else {
       session.write(LocalizedFtpReply.translate(session, request, context,
           FtpReply.REPLY_502_COMMAND_NOT_IMPLEMENTED, AUTH_COMMAND, null));
   }
   ```


-- 
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-unsubscr...@mina.apache.org

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


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

Reply via email to