用于 Azure Blob 存储的 Java SDK 使用 NFS,但我们希望在使用 blobclient 上传文件时使用 TLS 1.2。虽然帐户中的最低设置设置为 TLS 1.2,但客户端如何使用 TLS 1.2 从其应用程序上传文件?
BlobServiceClient blobSvcClient = new BlobServiceClientBuilder()
.endpoint(storageActUrl) // https://myaccount.blob.core.windows.net/testcontainer/blob.txt
.sasToken(sasToken)
.buildClient();
BlobClient blobClient = blobSvcClient.getBlobContainerClient(containerName).getBlobClient(blobName);
BlobHttpHeaders blobHeaders = new BlobHttpHeaders().setContentLanguage("en-US").setContentType("binary");
blobClient.uploadFromFile(filePath, null, headers, null, AccessTier.HOT, new BlobRequestConditions(), Duration.ofMinutes(30));