none
Can't access Azure blob via Shared Access Signatures using HTTPS in Java SDK RRS feed

  • 问题

  • I'm trying to access Azure blob via Shared Access Signatures using HTTPS in Java SDK and I got a SSLHandshakeException. I can successfully download the blob from browser via SAS, and I can access the blob using HTTP, so I guess it must be some certificate issues. The following are the code and the error details:

    =====Code=====

    String blobSASUri = "https://mystorage.blob.core.chinacloudapi.cn/mycontainer/myfile.txt?sv=2015-12-11&sr=b&sig=8iAChUIIQl2n%2BwYZJeDDfiOvuojdDm2AdHb8K3BGDGA%3D&st=2016-09-01T01%3A30%3A11Z&se=2016-09-01T02%3A35%3A11Z&sp=r";

    CloudBlockBlob blob = new CloudBlockBlob(new URI(blobSASUri));

    boolean exists = blob.exists(); //error happens

    =====Error=====

    StorageException

    Message: The server encountered an unknown failure:

    ErrorCode: SERVICE_INTERNAL_ERROR

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

    2016年9月1日 2:04

答案

  • Hi,

    我建议您去下载Microsoft Azure Explorer去查看您的SAS URL是否正确,Microsoft Azure Explorer下载地址: http://storageexplorer.com/。下面是软件的截图:

    您也可以通过这个工具生成SAS url然后测试下是否是代码的问题。如有任何反馈,欢迎继续提问。

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2016年9月1日 11:55
    版主