Using the ‘CURLS Amazon S3 upload’ MBS example and the following settings:
Dim AWSAccessKeyId As String = "<ABC123>"
Dim AWSSecretAccessKey As String = "<Password>"
Dim Region As String = "oss-eu-west-1"
Dim BucketName As String = "mybucketname"
Dim FileName As String = "LogoMBS.jpg"
Dim Service As String = "oss" 's3
Dim Path As String = "/" + BucketName + "/" + Filename
Dim Domain As String = "oss-eu-west-1.aliyuncs.com" // empty for auto
Dim Verb As String = "PUT"
Dim HashedPayload As String // empty for auto
No file is uploaded, it gives HTTPResult 403 and the following DebugMessage:
[code] Trying 8.208.40.20…
TCP_NODELAY set
Connected to oss-eu-west-1.aliyuncs.com (8.208.40.20) port 443 (#0)
ALPN, offering http/1.1
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.2 (IN), TLS handshake, Certificate (11):
TLSv1.2 (IN), TLS handshake, Server key exchange (12):
TLSv1.2 (IN), TLS handshake, Server finished (14):
TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
TLSv1.2 (OUT), TLS handshake, Finished (20):
TLSv1.2 (IN), TLS handshake, Finished (20):
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN, server accepted to use http/1.1
Server certificate:
subject: C=CN; ST=ZheJiang; L=HangZhou; O=Alibaba (China) Technology Co., Ltd.; CN=*.oss.aliyuncs.com
start date: Nov 30 08:06:04 2018 GMT
expire date: Dec 1 08:06:04 2019 GMT
issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Organization Validation CA - SHA256 - G2
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
PUT /cubeitz-london/LogoMBS.jpg HTTP/1.1
Host: oss-eu-west-1.aliyuncs.com
Accept-Encoding: gzip
Authorization: AWS4-HMAC-SHA256 Credential=LTAI4faqMQVGXq9Z/20190318/oss-eu-west-1/oss/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=b0d5b8ba847ce27233cf40f6828f6bc560f8564fc6dfad91adae2ae7599bef0f
Date: Mon, 18 Mar 2019 08:43:47 GMT
x-amz-content-sha256: 3a3f8a7e1a54bf8c16ed795b969e5edcfb536e2e898738f20b4692cb88fa0297
x-amz-date: 20190318T084347Z
Content-Length: 46411
We are completely uploaded and fine
HTTP/1.1 403 Forbidden
Server: AliyunOSS
Date: Mon, 18 Mar 2019 08:43:47 GMT
Content-Type: application/xml
Content-Length: 258
Connection: keep-alive
x-amz-request-id: 5C8F5A43A070F5412496D3F6
Connection #0 to host oss-eu-west-1.aliyuncs.com left intact[/code]
And OutputData:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
`SecondLevelDomainForbidden`
<Message>Please use virtual hosted style to access.</Message>
<RequestId>5C8F5A43A070F5412496D3F6</RequestId>
<HostId>oss-eu-west-1.aliyuncs.com</HostId>
</Error>