2017-03-07 22 views
0

嗨,大家目前我正在基於駱駝和java.There項目工作。有可能需要更改httphttps。 經過大量的研究,我能夠將我的restlet曝光到https。 但是,當我試圖從restclient打我的網址沒有迴應,甚至沒有錯誤。 當我在尋找開放的港口時,我可以在那裏找到我的港口。 我發送我的代碼和日誌以及我的代碼。 請有人幫我解決這個問題。如何使用駱駝restlet更改http到https

日誌生成

Mar 07, 2017 5:35:51 PM org.restlet.engine.connector.NetServerHelper start 
 
INFO: Starting the internal [HTTPS/1.1] server on port 8060 
 
[pache.camel.spring.Main.main()] RestletComponent    DEBUG Added method based router: [email protected] 
 
[pache.camel.spring.Main.main()] RestletComponent    DEBUG Attached restlet uriPattern: /jsonRestlet method: POST 
 
[pache.camel.spring.Main.main()] RestletComponent    DEBUG Attached methodRouter uriPattern: /jsonRestlet 
 
[pache.camel.spring.Main.main()] RestletComponent    DEBUG Started methodRouter uriPattern: /jsonRestlet 
 
[pache.camel.spring.Main.main()] SpringCamelContext    INFO Route: route1 started and consuming from: Endpoint[https://localhost:8060/jsonRestlet] 
 
[pache.camel.spring.Main.main()] ultManagementLifecycleStrategy DEBUG Load performance statistics disabled 
 
[pache.camel.spring.Main.main()] SpringCamelContext    INFO Total 1 routes, of which 1 are started. 
 
[pache.camel.spring.Main.main()] SpringCamelContext    INFO Apache Camel 2.17.2 (CamelContext: camel-1) started in 1.302 seconds 
 
[pache.camel.spring.Main.main()] MainSupport     DEBUG Starting Spring ApplicationContext: org[email protected]77575e6a 
 
[pache.camel.spring.Main.main()] DefaultListableBeanFactory  DEBUG Returning cached instance of singleton bean 'lifecycleProcessor' 
 
[pache.camel.spring.Main.main()] ClassPathXmlApplicationContext DEBUG Publishing event in org[email protected]77575e6a: org.springframework.context.event.ContextStartedEvent[source=org[email protected]77575e6a: startup date [Tue Mar 07 17:35:49 IST 2017]; root of context hierarchy] 
 
[pache.camel.spring.Main.main()] DefaultListableBeanFactory  DEBUG Returning cached instance of singleton bean 'camel-1' 
 
[pache.camel.spring.Main.main()] SpringCamelContext    DEBUG onApplicationEvent: org.springframework.context.event.ContextStartedEvent[source=org[email protected]77575e6a: startup date [Tue Mar 07 17:35:49 IST 2017]; root of context hierarchy] 
 
[pache.camel.spring.Main.main()] DefaultListableBeanFactory  DEBUG Returning cached instance of singleton bean 'camel-1'

我的要求

URL:: https://localhost:8060/jsonRestlet 
 
Request body::{"name":"mdnoorshid"}
<?xml version="1.0" encoding="UTF-8"?> 
 
<!-- Configures the Camel Context --> 
 

 
<beans xmlns="http://www.springframework.org/schema/beans" 
 
\t xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" 
 
\t xsi:schemaLocation=" 
 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
 
     http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> 
 

 
\t <camel:sslContextParameters id="mySslContext"> 
 
\t \t <camel:keyManagers keyPassword="bizruntime"> 
 
\t \t \t <camel:keyStore resource="C:\\Users\\deepalisingh\\Desktop\\keystore.jks" 
 
\t \t \t \t password="bizruntime" /> 
 
\t \t </camel:keyManagers> 
 
\t \t <camel:serverParameters clientAuthentication="WANT" /> 
 
\t </camel:sslContextParameters> 
 
    <bean id="sendPOST" class="com.bizruntime.CamelRestletHTTPS.HTTPSsendPost"></bean> 
 

 
\t <camelContext xmlns="http://camel.apache.org/schema/spring"> 
 
\t \t <route> 
 
\t \t \t <from uri="restlet:https://localhost:8060/jsonRestlet?restletMethod=POST&amp;sslContextParameters=#mySslContext"/> 
 
\t \t \t <to uri="bean:sendPOST?method=sendPost" /> 
 
\t \t </route> 
 
\t </camelContext> 
 

 
</beans>

+0

日誌在哪裏? –

+0

HTTPS默認爲443 –

+0

您好@SoucianceEqdamRashti你可以找到日誌。很抱歉,我忘記附上日誌了。感謝您的回覆。 –

回答

0

隨着當前的配置。
您將不得不在您的客戶端中導入SSL證書。
舉例來說,你可以參考@kellen回答,如何用Chrome做到這一點.. here