错误 - 通过SSL连接到Azure Blob存储容器时,PKIX路径构建失败 [英] Error - PKIX path building failed - while connecting to Azure Blob storage container over SSL

查看:142
本文介绍了错误 - 通过SSL连接到Azure Blob存储容器时,PKIX路径构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过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

推荐答案

该消息表示Java密钥库中可能缺少Azure服务的证书。我建议关注这个

教程
,显示如何将根证书添加到java CA证书库。如果这有帮助,请告诉我。

The message means that a certificate for Azure services maybe missing from Java's keystore. I'd recommend following this Tutorial showing how to add a root certificate to the java CA certificates store. Let me know if this helps.


这篇关于错误 - 通过SSL连接到Azure Blob存储容器时,PKIX路径构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆