如何从OpenShift容器中获取一个`https://`URL

时间:2016-03-31 00:44:26

标签: api curl https openshift

跟进my earlier question,我意识到即使我通过SSH连接到我的OpenShift容器并尝试手动cURL一个HTTPS URL,它似乎也会在内部重新路由到HTTP等价物。我怎样才能真正访问HTTPS版本?

从我的本地机器:

$ curl -X POST -H “Authorization: Basic <TOKEN>” -H “Content-Type: application/x-www-form-urlencoded” -H “Content-Length: 0” https://api.stubhub.com/login
{”error”:”invalid_request”,”error_description”:”Missing grant_type parameter value”}

从我的远程机器(通过SSH):

> curl -X POST -H “Authorization: Basic <TOKEN>” -H “Content-Type: application/x-www-form-urlencoded” -H “Content-Length: 0” https://api.stubhub.com/login
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>

You don't have permission to access “http&#58;&#47;&#47;api&#46;stubhub&#46;com&#47;login” on this server.<P>
Reference&#32;&#35;18&#46;63de6bd1&#46;1459386064&#46;30c676b
</BODY>
</HTML>

请注意后者的回复正文中的http网址。

(当然,我正在使用工作/测试<TOKEN>。)

1 个答案:

答案 0 :(得分:1)

您应该联系stubhub并查看它们是否阻止您尝试连接的IP地址。我可以毫无问题地从OpenShift Online中卷曲其他https网址。