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/07/07 15:47:04 UTC

[GitHub] [httpcomponents-core] veselov opened a new pull request #295: Resolves HTTPCORE-682

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


   This change ads support for specifying JCA provider for loading trust manager/key managers.
   Without this fix, the corresponding providers have to be loaded into the system which is not always desirable or possible.
   
   I've refactored the `testBuildWithProvider..()` tests along the way, as they wouldn't have failed even if the `setProvider()` instruction was missing. The `DummyProvider` is quite wonky, but it does the job of verifying that the specified provider has been used.
   
   LMK if there are any problems with this. The same change should go into 5.0/5.1 as well.


-- 
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 pull request #295: Resolves HTTPCORE-682

Posted by GitBox <gi...@apache.org>.
ok2c commented on pull request #295:
URL: https://github.com/apache/httpcomponents-core/pull/295#issuecomment-876169373


   @veselov The changeset looks good to me. However I do nto think it can go into the 4.4.x 5.0.x or 5.1.x stable branches due to introduction of new API methods. Could you please port it to master (5.2) first? Please also add `@since 5.2` to all new public methods.


-- 
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 pull request #295: Resolves HTTPCORE-682

Posted by GitBox <gi...@apache.org>.
ok2c commented on pull request #295:
URL: https://github.com/apache/httpcomponents-core/pull/295#issuecomment-878042837


   > Has the policy been changed since then?
   @veselov Yes, it has. Things got really out of hand during the 5.0 ALPHA and BETA development phases for various reasons, resource shortage being the main one.


-- 
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 pull request #295: Resolves HTTPCORE-682

Posted by GitBox <gi...@apache.org>.
ok2c commented on pull request #295:
URL: https://github.com/apache/httpcomponents-core/pull/295#issuecomment-878044902


   Superseded by #296


-- 
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] veselov commented on pull request #295: Resolves HTTPCORE-682

Posted by GitBox <gi...@apache.org>.
veselov commented on pull request #295:
URL: https://github.com/apache/httpcomponents-core/pull/295#issuecomment-877832942


   > @veselov The changeset looks good to me. However I do nto think it can go into the 4.4.x 5.0.x or 5.1.x stable branches due to introduction of new API methods. Could you please port it to master (5.2) first? Please also add `@since 5.2` to all new public methods.
   
   Changes for master: https://github.com/apache/httpcomponents-core/pull/296
   
   However, I do see that some APIs are added in the patch releases. For example `SSLContextBuilder.setKeyStoreType()` has been added in `4.4.7`. Has the policy been changed since then?


-- 
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 #295: Resolves HTTPCORE-682

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



##########
File path: httpcore/src/test/java/org/apache/http/ssl/DummyProvider.java
##########
@@ -0,0 +1,64 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.ssl;
+
+import java.security.Provider;
+import java.security.Security;
+import java.util.HashSet;
+import java.util.Set;
+
+public class DummyProvider extends Provider {

Review comment:
       @veselov Should not it be possible to use Mockito spy for the same end here?




-- 
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 closed pull request #295: Resolves HTTPCORE-682

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


   


-- 
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] veselov commented on a change in pull request #295: Resolves HTTPCORE-682

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



##########
File path: httpcore/src/test/java/org/apache/http/ssl/DummyProvider.java
##########
@@ -0,0 +1,64 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.ssl;
+
+import java.security.Provider;
+import java.security.Security;
+import java.util.HashSet;
+import java.util.Set;
+
+public class DummyProvider extends Provider {

Review comment:
       I've tried using `Mockito.spy` on returned `Service` objects to alter the `Service.getProvider()` response - that would have made it easier to test whether the provider was used. However, that was failing with some security exceptions. As to replacing the `DummyProvider` with a spied on class - I'm not sure how I can do that - i.e. what would I spy on, since the whole point of the change is for me to supply some alternative provider, so I need to use an implementation of `Provider`, and that's an abstract class.
   
   Said that, I'm really not well versed on Mockito, if you have ideas how this can be simplified - I'll gladly adopt them.




-- 
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