问题描述
我正在尝试通过https连接Azure Blob存储以列出容器中的blob项。
I am trying to connect to Azure Blob Storage over https to list blob items from a container.
以下是我用来连接容器的代码片段:
Following is the code snippet I am using to connect to the container:
1:CloudBlobContainer blobContainer = cloudBlobClient.getContainerReference(containerName);
2:
3:      if(blobContainer .exists()){
4:          for(ListBlobItem blobItem:blobContainer .listBlobs()){
5: if(blobItem.getUri()。toString()。endsWith(fileNameSuffix)){
6:         blobItemList.add(blobItem);
7: }
8: }¥b $ b 9:      }
1: CloudBlobContainer blobContainer = cloudBlobClient.getContainerReference(containerName);
2:
3: if (blobContainer .exists()) {
4: for (ListBlobItem blobItem : blobContainer .listBlobs()) {
5: if (blobItem.getUri().toString().endsWith(fileNameSuffix)) {
6: blobItemList.add(blobItem);
7: }
8: }
9: }
当我点击第3行(blobContainer .exists())时,我得到以下异常:
when I hit line 3 (blobContainer .exists()), I get the following exception:
" javax.net.ssl。 SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径"
"javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
以下是天蓝色我的pom.xml中的依赖项
Following are the azure dependencies in my pom.xml
<依赖关系>
< groupId> com.microsoft.azure< / groupId>
< artifactId> azure-storage< / artifactId>
< version> 8.3.0< / version>
< / dependency>
< dependency>
< groupId> com.microsoft.azure< / groupId>
< artifactId> adal4j< / artifactId>
< version> 1.6.3< / version>
< / dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage</artifactId>
<version>8.3.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.6.3</version>
</dependency>
存储空间我用来测试的帐户有一个允许"所有网络"的帐号。访问。请告知如何解决这个问题。
The storage account I am using to test has an allow "All networks" access. Please advice on how can this issue be resolved
推荐答案
这篇关于错误 - 通过SSL连接到Azure Blob存储容器时,PKIX路径构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!