使用localhost(127.0.0.1)

时间:2017-06-27 19:50:01

标签: https postman ssh-tunnel

我想在Postman with Basic Authorization中对以下网址进行GET:

https://1.2.3.4:8338/accounts

不幸的是我无法直接连接到该服务器,因此我使用SSH隧道管理器和

通过Jump服务器5.6.7.8进行隧道传输
ssh -N -p 22 username@5.6.7.8 -o StrictHostKeyChecking=no -L 127.0.0.1:8080:1.2.3.4:8338

那很有用。我现在想要通过使用AWSV4授权对此URL执行PUT来创建容器:

https://1.2.3.4/testcontainer

如果我使用上面的调谐器,我会收到404错误。我有一种感觉,我的问题是隧道是在端口8338上,但我的URL没有指定端口。我已经尝试将1.2.3.4上的端口留空但它默认为0并且隧道不起作用。

然后我尝试将该端口设置为443(默认HTTPS端口)。当我这样做时,我收到SignatureDoesNotMatch错误。我认为这是因为我在端口8338上设置了AWSV4身份验证(这是猜测)。

最后,我尝试使用端口443设置AWSV4授权,但收到403错误。

我不确定现在要去哪里。任何人都可以使用localhost建议我可能需要对下面的URL进行PUT吗?

https://1.2.3.4/testcontainer

更新2017-06-28

我可以访问可以直接连接到1.2.3.4的服务器,并决定尝试在终端中使用curl。它不起作用,因为我需要使用AWS v4 auth。在调查这个时,我遇到了s3curl。我试过运行以下内容:

./s3curl.pl --id personal -- -s -v -X PUT https://1.2.3.4/testcontainer -k

仍然没有运气。这是输出:

* Hostname was NOT found in DNS cache
*   Trying 1.2.3.4...
* Connected to 1.2.3.4 (1.2.3.4) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Request CERT (13):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-SHA384
* Server certificate:
*    subject: C=US; ST=T; L=A; O=B; CN=access01.b.com;       emailAddress=b@us.b.com
*    start date: 2017-06-04 08:05:04 GMT
*    expire date: 2018-06-05 08:25:00 GMT
*    issuer: C=US; ST=I; L=C; O=cc; CN=Manager CA; serialNumber=serialnumber
*    SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> PUT /testcontainer HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 1.2.3.4
> Accept: */*
> Date: Wed, 28 Jun 2017 13:23:01 +0000
> Authorization: AWS authoization
> 
< HTTP/1.1 403 Forbidden
< Date: Wed, 28 Jun 2017 13:23:01 GMT
< X-Clv-Request-Id: requestid
< Accept-Ranges: bytes
* Server cc/3.1.0.1 is not blacklisted
< Server: cc/3.1.0.1
< X-Clv-S3-Version: 2.5
< x-amz-request-id: requestid
< Content-Type: application/xml
< Content-Length: 894
< 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error>   <Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. For more information, see REST Authentication and SOAP Authentication for details.</Message><Resource>/pctestcontainer1/</Resource><RequestId>bfb1bdf1-9d7a-4bc7-966a-a3a5e89498eb</RequestId><StringToSign>PUT


Wed, 28 Jun 2017 13:23:01 +0000
* Connection #0 to host 10.137.63.202 left intact
/pctestcontainer1</StringToSign><StringToSignBytes>80 85 84 10 10 10 87 101 100 44 32 50 56 32 74 117 110 32 50 48 49 55 32 49 51 58 50 51 58 48 49 32 43 48 48 48 48 10 47 112 99 116 101 115 116 99 111 110 116 97 105 110 101 114 49</StringToSignBytes><SignatureProvided>signature</SignatureProvided><AWSAccessKeyId>accesskey</AWSAccessKeyId><httpStatusCode>403</httpStatusCode></Error>root@utility:/tmp/cp/s3curl#

这对任何人都意味着什么吗?

1 个答案:

答案 0 :(得分:0)

经过大量调查后,我发现我需要包含一个&#34; Host&#34;键入我的标题并使用我生成的AWS V4凭据。

我现在可以使用Postman中的声明进行PUT。

相关问题