[jira] [Commented] (JCLOUDS-1617) Fix HTTPS support in OkHttpCommandExecutorService
[ https://issues.apache.org/jira/browse/JCLOUDS-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17605426#comment-17605426 ] ASF subversion and git services commented on JCLOUDS-1617: -- Commit d913a5603727d10d6b85afa68c5ed6f6027f3e94 in jclouds's branch refs/heads/master from SATYANAN-ANAND [ https://gitbox.apache.org/repos/asf?p=jclouds.git;h=d913a56037 ] JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService (#153) * JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService Added support for proxy server type = HTTPS * Update DelegatingSocketFactory.java Added java doc > Fix HTTPS support in OkHttpCommandExecutorService > - > > Key: JCLOUDS-1617 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1617 > Project: jclouds > Issue Type: Bug >Reporter: Anand >Assignee: Andrew Gaul >Priority: Major > Time Spent: 1h 50m > Remaining Estimate: 0h > > Hi, > In our project, we need to support Proxy Server with HTTPS type. > When the API request is called, OkHttpCommandExecutorService.invoke method > doesn't support ssl during okHttpClient builder. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[GitHub] [jclouds] nacx merged pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService
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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Comment Edited] (JCLOUDS-1615) Using Azure SAS Token unable to upload some parts of the file (blockid is "Not a valid base64 string")
[ https://issues.apache.org/jira/browse/JCLOUDS-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17605198#comment-17605198 ] Christian Jung edited comment on JCLOUDS-1615 at 9/15/22 1:34 PM: -- I added a [PR#155|https://github.com/apache/jclouds/pull/155], but, as i have no experience with github, it might not be linked correctly to this issue. was (Author: JIRAUSER295693): I added a PR #155, but, as i have no experience with github, it might not be linked correctly to this issue. > Using Azure SAS Token unable to upload some parts of the file (blockid is > "Not a valid base64 string") > -- > > Key: JCLOUDS-1615 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1615 > Project: jclouds > Issue Type: Bug > Components: jclouds-blobstore >Affects Versions: 2.5.0 >Reporter: Amber Liu >Assignee: Andrew Gaul >Priority: Major > Labels: azureblob > > I'm trying to [put > block|https://docs.microsoft.com/en-us/rest/api/storageservices/put-block#request] > with Azure SAS Token. > However, it failed in some "specific" parts. > Here is the error message: > {code:java} > org.jclouds.azure.storage.AzureStorageResponseException: command > [method=org.jclouds.azureblob.AzureBlobClient.public abstract void > org.jclouds.azureblob.AzureBlobClient.putBlock(java.lang.String,java.lang.String,java.lang.String,org.jclouds.io.Payload)[azure-auto-123, > sub2/100MBFile, AAV+QA==, [content=true, contentMetadata=[cacheControl=null, > contentDisposition=null, contentEncoding=null, contentLanguage=null, > contentLength=1048576, contentMD5=null, contentType=application/unknown, > expires=null], written=false, isSensitive=false]], request=PUT > https://casbazure.blob.core.windows.net/azure-auto-123/sub2/100MBFile?comp=block=AAV%2BQA%3D%3D > HTTP/1.1] failed with code 400, error: > AzureError{requestId='5b9a2f41-301e-008d-4e5b-97e57d00', > code='InvalidQueryParameterValue', message='Value for one of the query > parameters specified in the request URI is invalid. > RequestId:5b9a2f41-301e-008d-4e5b-97e57d00 > Time:2022-07-14T08:24:41.1097266Z', context='{QueryParameterValue=AAV QA==, > QueryParameterName=blockid, Reason=Not a valid base64 string.}'} {code} > As you can see, the *blockid* becomes "AAV QA==" which is a invalid base64 > string. > > *My Observation* > I checked the failed parts and they all have "+" in their *blockid.* > For example, from part 1 to part 500, the following parts have "+" in their > blockid : > > ||Part Number||blockid|| > |248|+A==| > |249|+Q==| > |250|+g==| > |251|+w==| > > I used the same code in > [here|https://github.com/apache/jclouds/blob/0b89ee0825d45de1193090cdd5efc5f1135fa200/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java#L444-L450] > to generate *blockid* > {code:java} > String blockId = BaseEncoding.base64().encode(Ints.toByteArray(partNumber)); > {code} > > And my version of *guava* is 27.1-jre which is used in jclouds 2.5.0 > {code:java} > > com.google.guava > guava > 27.1-jre > {code} > > By the way, it works fine with *Azure account name* and {*}account key{*}. > I can successfully upload all parts. > (I think the *blockid* still has "+" but I don't know why it works with > *Azure account name* and {*}account key{*}) > > Please help me to fix this problem. Thank you! -- This message was sent by Atlassian Jira (v8.20.10#820010)
[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService
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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [jclouds] nacx merged pull request #154: Bump snakeyaml from 1.26 to 1.31 in /apis/byon
nacx merged PR #154: URL: https://github.com/apache/jclouds/pull/154 -- 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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [jclouds] nacx commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService
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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService
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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService
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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [jclouds] SATYANAN-ANAND commented on a diff in pull request #153: JCLOUDS-1617: Fix HTTPS support in OkHttpCommandExecutorService
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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (JCLOUDS-1615) Using Azure SAS Token unable to upload some parts of the file (blockid is "Not a valid base64 string")
[ https://issues.apache.org/jira/browse/JCLOUDS-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17605198#comment-17605198 ] Christian Jung commented on JCLOUDS-1615: - I added a PR #155, but, as i have no experience with github, it might not be linked correctly to this issue. > Using Azure SAS Token unable to upload some parts of the file (blockid is > "Not a valid base64 string") > -- > > Key: JCLOUDS-1615 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1615 > Project: jclouds > Issue Type: Bug > Components: jclouds-blobstore >Affects Versions: 2.5.0 >Reporter: Amber Liu >Assignee: Andrew Gaul >Priority: Major > Labels: azureblob > > I'm trying to [put > block|https://docs.microsoft.com/en-us/rest/api/storageservices/put-block#request] > with Azure SAS Token. > However, it failed in some "specific" parts. > Here is the error message: > {code:java} > org.jclouds.azure.storage.AzureStorageResponseException: command > [method=org.jclouds.azureblob.AzureBlobClient.public abstract void > org.jclouds.azureblob.AzureBlobClient.putBlock(java.lang.String,java.lang.String,java.lang.String,org.jclouds.io.Payload)[azure-auto-123, > sub2/100MBFile, AAV+QA==, [content=true, contentMetadata=[cacheControl=null, > contentDisposition=null, contentEncoding=null, contentLanguage=null, > contentLength=1048576, contentMD5=null, contentType=application/unknown, > expires=null], written=false, isSensitive=false]], request=PUT > https://casbazure.blob.core.windows.net/azure-auto-123/sub2/100MBFile?comp=block=AAV%2BQA%3D%3D > HTTP/1.1] failed with code 400, error: > AzureError{requestId='5b9a2f41-301e-008d-4e5b-97e57d00', > code='InvalidQueryParameterValue', message='Value for one of the query > parameters specified in the request URI is invalid. > RequestId:5b9a2f41-301e-008d-4e5b-97e57d00 > Time:2022-07-14T08:24:41.1097266Z', context='{QueryParameterValue=AAV QA==, > QueryParameterName=blockid, Reason=Not a valid base64 string.}'} {code} > As you can see, the *blockid* becomes "AAV QA==" which is a invalid base64 > string. > > *My Observation* > I checked the failed parts and they all have "+" in their *blockid.* > For example, from part 1 to part 500, the following parts have "+" in their > blockid : > > ||Part Number||blockid|| > |248|+A==| > |249|+Q==| > |250|+g==| > |251|+w==| > > I used the same code in > [here|https://github.com/apache/jclouds/blob/0b89ee0825d45de1193090cdd5efc5f1135fa200/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobStore.java#L444-L450] > to generate *blockid* > {code:java} > String blockId = BaseEncoding.base64().encode(Ints.toByteArray(partNumber)); > {code} > > And my version of *guava* is 27.1-jre which is used in jclouds 2.5.0 > {code:java} > > com.google.guava > guava > 27.1-jre > {code} > > By the way, it works fine with *Azure account name* and {*}account key{*}. > I can successfully upload all parts. > (I think the *blockid* still has "+" but I don't know why it works with > *Azure account name* and {*}account key{*}) > > Please help me to fix this problem. Thank you! -- This message was sent by Atlassian Jira (v8.20.10#820010)
[GitHub] [jclouds] ChJung1 opened a new pull request, #155: Jclouds 1615
ChJung1 opened a new pull request, #155: URL: https://github.com/apache/jclouds/pull/155 Hi @gaul, This is my first github pull request, so forgive me if i did something the wrong way. I tried to add a test, but feel that it kind of doesn't test the core of the problem. Feedback welcome. ChJung1 -- 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-unsubscr...@jclouds.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org