You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2021/12/08 20:42:41 UTC

[GitHub] [httpcomponents-core] arturobernalg opened a new pull request #337: Check if a given protocol is enabled.

arturobernalg opened a new pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337


   Creating the unit tests for the enum `TLS` I realized that was not possible to check if the method `TLS.excludeWeak` it worked as expected and excluded the disabled protocols, without having to manually check one by one.
   
   Now it's possible to check if a given protocol its enabled.


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

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



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


[GitHub] [httpcomponents-core] ok2c commented on a change in pull request #337: Check if a given protocol is enabled.

Posted by GitBox <gi...@apache.org>.
ok2c commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765265142



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,14 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is enabled.
+     *
+     * @return {@code true} if the given protocol is enabled, otherwise return {@code false}.
+     * @since 5.2
+     */
+    public static boolean isEnable(final String protocol) {

Review comment:
       @arturobernalg `#isSecure` should be a better name. Method description should be: `Check if a given protocol is considered secure and is enabled by default.`




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

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



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


[GitHub] [httpcomponents-core] michael-o commented on a change in pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765485057



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,15 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is considered secure and is enabled by default.
+     *
+     * @return {@code true} if the given protocol is secure and enabled, otherwise return {@code
+     * false}.
+     * @since 5.2
+     */
+    public static boolean isSecureAndEnable(final String protocol) {

Review comment:
       `isSecureAndEnabled`?




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

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



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


[GitHub] [httpcomponents-core] arturobernalg commented on a change in pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765482674



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,14 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is enabled.
+     *
+     * @return {@code true} if the given protocol is enabled, otherwise return {@code false}.
+     * @since 5.2
+     */
+    public static boolean isEnable(final String protocol) {

Review comment:
       changed.
   TY




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

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



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


[GitHub] [httpcomponents-core] ok2c commented on a change in pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
ok2c commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765593321



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,15 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is considered secure and is enabled by default.
+     *
+     * @return {@code true} if the given protocol is secure and enabled, otherwise return {@code
+     * false}.
+     * @since 5.2
+     */
+    public static boolean isSecureAndEnabled(final String protocol) {

Review comment:
       @arturobernalg I think the name is still bad and misleading. Protocols are enabled by default because they are consdiered secure. You should change the name to `isSecureAndEnabledByDefault` or to `isSecure`.




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

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



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


[GitHub] [httpcomponents-core] arturobernalg commented on a change in pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765663620



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,15 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is considered secure and is enabled by default.
+     *
+     * @return {@code true} if the given protocol is secure and enabled, otherwise return {@code
+     * false}.
+     * @since 5.2
+     */
+    public static boolean isSecureAndEnabled(final String protocol) {

Review comment:
       HI @ok2c 
   I see. I change the name in favor of `isSecure`. 
   TY




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

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



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


[GitHub] [httpcomponents-core] michael-o commented on a change in pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765665919



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,15 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is considered secure and is enabled by default.
+     *
+     * @return {@code true} if the given protocol is secure and enabled, otherwise return {@code
+     * false}.
+     * @since 5.2
+     */
+    public static boolean isSecureAndEnabled(final String protocol) {

Review comment:
       > HI @ok2c I see. I change the name in favor of `isSecure`. TY
   
   Yeah, had the same thought.




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

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



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


[GitHub] [httpcomponents-core] ok2c merged pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
ok2c merged pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337


   


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

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



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


[GitHub] [httpcomponents-core] arturobernalg commented on a change in pull request #337: Check if a given protocol is secure and enabled.

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #337:
URL: https://github.com/apache/httpcomponents-core/pull/337#discussion_r765492605



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/http/ssl/TLS.java
##########
@@ -94,4 +94,15 @@ public static ProtocolVersion parse(final String s) throws ParseException {
         return enabledProtocols.toArray(new String[0]);
     }
 
+    /**
+     * Check if a given protocol is considered secure and is enabled by default.
+     *
+     * @return {@code true} if the given protocol is secure and enabled, otherwise return {@code
+     * false}.
+     * @since 5.2
+     */
+    public static boolean isSecureAndEnable(final String protocol) {

Review comment:
       changed.
   TY




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

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



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