使用API Manager 1.7我发布了一个公共API,我希望订阅者只使用HTTPS访问。配置API时,我将传输设置为仅限https,并指向有效的其余网址,例如https://en.wikipedia.org/w/api.php
当我从API Manager Store订阅API时,我看到了我的API,但它同时提供了http和https端点,即使我只指定了https。
http://192.168.104.42:8280/wiki/1.0.0
https://192.168.104.42:8243/wiki/1.0.0
当我订阅API并使用内置REST客户端进行测试或通过CURL进行独立测试时,我能够成功访问HTTP端点,但在尝试访问HTTPS端点时获取403 Forbidden。解决这个问题的任何帮助都非常感谢?
在服务器日志中,我看到:
[2014-07-08 16:13:34,339] ERROR - XMLHttpRequestHostObject Stream closed
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162
)
at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLe
ngthInputStream.java:170)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInpu
tStream.java:108)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInpu
tStream.java:127)
at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMeth
odBase.java:690)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.executeRequest
(XMLHttpRequestHostObject.java:528)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.send(XMLHttpRe
questHostObject.java:517)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.jsFunction_sen
d(XMLHttpRequestHostObject.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java
:85)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0._c_anonymous_
1(/store/site/blocks/api/tryit/ajax/api-tryit.jag:42)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.call(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0._c_script_0(/
store/site/blocks/api/tryit/ajax/api-tryit.jag:5)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.call(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
94)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:309
1)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.call(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.exec(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.
java:570)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:2
73)
at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManage
r.java:432)
at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:
29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
tionDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:379)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:339)
at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:
21)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:99)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(C
ompositeValve.java:178)
at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTo
mcatValve.java:47)
at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoa
derValve.java:56)
at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(T
omcatValveContainer.java:47)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValv
e.java:141)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.inv
oke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
936)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(Ca
rbonContextCreatorValve.java:52)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:589)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoin
t.java:1653)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)