garydgregory commented on code in PR #581:
URL: 
https://github.com/apache/httpcomponents-client/pull/581#discussion_r1768575963


##########
httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java:
##########
@@ -456,4 +461,33 @@ void verifySession(
         }
     }
 
+    /**
+     * Sanitizes an X500Principal by escaping control characters.
+     * <p>
+     * This method processes the RFC2253 format of the X500Principal and 
escapes
+     * any ISO control characters to avoid issues in logging or other outputs.
+     * Control characters are replaced with their escaped hexadecimal 
representation.
+     * </p>
+     *
+     * <p><strong>Note:</strong> For testing purposes, this method is 
package-private
+     * to allow access within the same package. This allows tests to verify 
the correct
+     * behavior of the sanitization process.</p>
+     *
+     * @param principal the X500Principal to sanitize
+     * @return the sanitized string representation of the X500Principal
+     */
+    @Internal
+    String sanitizeX500Principal(final X500Principal principal) {

Review Comment:
   Hi @arturobernalg 
   I would call this method `toCleanString()` or `toEscapedString()`. IMO, when 
a Javadoc reads like "Does X by doing Y", where both X and Y and very short, 
this usually means a name can be improved..



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

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


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

Reply via email to