2014-11-07 4 views
2

사용자가 파일을 업로드 할 수있는 페이지를 만들었습니다. 이 코드 조각은 내 Amazon S3 버킷에 파일을 보냅니다.브라우저에서 S3 (Amazon) 및 https로 직접 업로드 문제

<form action="https://BUCKET.s3-eu-west-1.amazonaws.com/" method="post" enctype="multipart/form-data"> 
    <input type="hidden" name="awsAccessKey" value="ACCESS_KEY"> 
    <input type="hidden" name="awsSecretKey" value="SECRET_KEY"> 
    <input type="hidden" name="acl" value="private"> 
    <input type="hidden" name="policy" value="POLICY"> 
    <input type="hidden" name="signature" value="SIGNATURE"> 
    <input type="hidden" name="Content-Type" value=""> 
    <!-- Include any additional input fields here --> 

    File to upload to S3: 
    <input name="file" type="file"> 
    <br> 
    <input type="submit" value="Upload File to S3"> 
</form> 

모든 것이 정상적으로 작동하지만 https 문제가 발생합니다. 주요 브라우저는 s3-eu-west-1.amazonaws.com을 신뢰하지 않으며 신뢰할 수없는 연결에 대한 보안 메시지를 표시합니다.

HTTPS 연결을 HTTP로 변경하여 고객이 문제에 직면하지 않도록했습니다. 누군가이 문제를 해결하는 방법에 대한 아이디어가 있습니까?

+2

버킷 이름에 '.'이 있습니까? – ceejayoz

답변

3

버킷 이름에 점이 찍힐 확률이 높습니다. Amazon의 S3 와일드 카드 인증서는 하위 도메인의 한 수준에만 적합하므로 bucket.s3-eu-west-1.amazonaws.com은 괜찮지 만 bucket.bucket.s3-eu-west-1.amazonaws.com은 그렇지 않습니다. 대신 다음을 사용하십시오 :

https://s3-eu-west-1.amazonaws.com/BUCKET/ 
+0

정확히. 정말 고맙습니다! –