You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by GitBox <gi...@apache.org> on 2022/08/09 10:10:03 UTC

[GitHub] [jclouds] SATYANAN-ANAND opened a new pull request, #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

SATYANAN-ANAND opened a new pull request, #153:
URL: https://github.com/apache/jclouds/pull/153

   Added support for  proxy server type = HTTPS


-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] nacx commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
nacx commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r970558615


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   My point is that unless I'm missing something this `DelegatingSocketFactory` doesn't add any logic and it's doing nothing. Why do we need it?



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] nacx commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
nacx commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r971855268


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Thanks for the explanation!
   Can you add this motivation in a comment in the code so anyone reading it can easily get why it is done this way?



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
SATYANAN-ANAND commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r969621865


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Hi 
   
   I was referring below issue to fix this issue. 
   
   https://github.com/square/okhttp/issues/6561#issuecomment-782308646
   https://github.com/square/okhttp/issues/6561#issuecomment-782292563



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
SATYANAN-ANAND commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r971808681


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Hi,
   
   Builder.setSSLSocketFactory is deprecated which force to use Builder.setSocketFactory
   but setSocketFactory doesnot accept SSLSocketfactory.getDefault() and throws "java.lang.IllegalArgumentException: socketFactory instanceof SSLSocketFactory" at **runtime**
   
   To overcome the above problem, a delegator class called "DelegatingSocketFactory" created which delegates instance of SSLSocketFactory to SocketFactory 



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
SATYANAN-ANAND commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r971974123


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Ok. I will do. Thanks!



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
SATYANAN-ANAND commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r971808681


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Hi,
   
   Builder.setSSLSocketFactory is deprecated which force to use Builder.setSocketFactory
   but setSocketFactory doesnot accept SSLSocketfactory.getDefault() and throws "java.lang.IllegalArgumentException: socketFactory instanceof SSLSocketFactory" at **runtime**
   
   To overcome the above problem, a delegator class called "DelegatingSocketFactory" created which delegates instance of SSLSocketFactory to SocketFactory 
   
   If you are not ok with this approach!. Could you please suggest an alternative approach



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
SATYANAN-ANAND commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r971808681


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Hi,
   
   Builder.setSSLSocketFactory is deprecated which force to use Builder.setSocketFactory
   but setSocketFactory doesnot accept SSLSocketfactory.getDefault() and throws "java.lang.IllegalArgumentException: socketFactory instanceof SSLSocketFactory" at **runtime**
   
   To overcome the above problem, a delegator class called "DelegatingSocketFactory" created which delegates instance of SSLSocketFactory to SocketFactory 
   
   Please let me know is there any alternate way to handle this.



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
SATYANAN-ANAND commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r969621865


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Hi 
   
   I was referring below issue to fix this. 
   
   https://github.com/square/okhttp/issues/6561#issuecomment-782308646
   https://github.com/square/okhttp/issues/6561#issuecomment-782292563



-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] nacx merged pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
nacx merged PR #153:
URL: https://github.com/apache/jclouds/pull/153


-- 
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: notifications-unsubscribe@jclouds.apache.org

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


[GitHub] [jclouds] nacx commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService

Posted by GitBox <gi...@apache.org>.
nacx commented on code in PR #153:
URL: https://github.com/apache/jclouds/pull/153#discussion_r957051597


##########
drivers/okhttp/src/main/java/org/jclouds/http/okhttp/DelegatingSocketFactory.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.jclouds.http.okhttp;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+public class DelegatingSocketFactory extends SocketFactory {

Review Comment:
   Why is this class needed?



-- 
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: notifications-unsubscribe@jclouds.apache.org

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