2012-03-02 11 views
9

से रीडायरेक्टिंग मैं गैर-एसएसएल पोर्ट 8080 पर एसएसएल पोर्ट 8443 (जेबॉस 4.2.3.जीए संस्करण पर) पर यातायात को पुनर्निर्देशित करने की कोशिश कर रहा हूं, लेकिन यह काम नहीं कर रहा है। जब मैं इस बंदरगाह पर अपने वेबपैलिकेशन तक पहुंचता हूं तो यह उस बंदरगाह पर रहता है और पृष्ठ प्रदर्शित होता है। यहाँ server.xml फ़ाइलगैर एसएसएल पोर्ट 8080 से एसएसएल पोर्ट 8443

<Connector port="8080" address="${jboss.bind.address}"  
    maxThreads="250" maxHttpHeaderSize="8192" 
    emptySessionPath="true" protocol="HTTP/1.1" 
    enableLookups="false" redirectPort="8443" acceptCount="100" 
    connectionTimeout="20000" disableUploadTimeout="true"/> 

<!-- Define a SSL HTTP/1.1 Connector on port 8443 
    This connector uses the JSSE configuration, when using APR, the 
    connector should be using the OpenSSL style configuration 
    described in the APR documentation --> 

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" 
      maxThreads="150" scheme="https" secure="true" 
      clientAuth="false" sslProtocol="TLS" keystoreFile="conf/sds/keystore"/> 

में मेरी विन्यास यहाँ है web.xml विन्यास

<security-constraint> 
    <web-resource-collection> 
    <web-resource-name>SUCTR</web-resource-name> 
    <url-pattern>/*</url-pattern>  
    </web-resource-collection> 
    <user-data-constraint> 
    <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

मैं डिफ़ॉल्ट पोर्ट 80 और 443 का उपयोग करते हुए और यह भी यूआरएल पैटर्न में विशिष्ट पथ का उपयोग कर की कोशिश की है और लेकिन अभी भी यह काम नहीं कर रहा है। मुझे यकीन नहीं है कि मैं यहां क्या कर रहा हूं, क्या आप मुझे सही दिशा में इंगित कर सकते हैं।

धन्यवाद।

+0

[इस कड़ी] (http://www.journaldev.com/160/steps-to-configure-ssl-on-tomcat-and-setup-auto-redirect-from-http-to-https) प्रक्रिया बताते हैं। – Adil

+0

क्या यह संभव है कि पोर्ट नंबर वही रहता है और केवल यह https पर रीडायरेक्ट करता है? – shzyincu

उत्तर

0

यह सही दिखता है। मुझे लगता है कि आप सुरक्षा-बाधा टैग बंद कर रहे हैं। यूआरएल पैटर्न को "/ APP_URI/*" में बदलने का प्रयास करें और देखें कि ऐप तक पहुंचने पर इससे कोई फर्क पड़ता है या नहीं।

10

<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>App_nmae</web-resource-name> 
     <url-pattern>/*</url-pattern> 
     <http-method>GET</http-method> 
     <http-method>POST</http-method> 
    </web-resource-collection> 

    <user-data-constraint> 
     <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

sever.xml में संपादित web.xml में संपादित

<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" 
      maxThreads="150" scheme="https" secure="true" 
      clientAuth="false" sslProtocol="TLS" 
      keystoreFile="/opt/apache-tomcat-6.0.13/.keystore" 
      keystorePass="changeit"/> 

यह मेरे लिए काम कर रहा है ..you यह कोशिश कर सकते हैं

+0

क्या यह संभव है कि पोर्ट नंबर वही रहता है और केवल यह https पर रीडायरेक्ट करता है? – shzyincu

संबंधित मुद्दे