2010-12-27 11 views
0

私は私のウェブサイトで2パスしている+ SSL + Tomcatの6.0.26Tomcat 6でSSLから非SSLに戻す方法は?

をJSF 2つの+ JAASを使用しています:

/顔//SSL

/顔を使用する* /保護保護されていない/ * SSLを使用していません。

私は私のweb.xmlにこれを入れている:

<login-config> 
     <auth-method>FORM</auth-method> 
     <form-login-config> 
      <form-login-page>/faces/login.jsp</form-login-page> 
      <form-error-page>/faces/error.jsp</form-error-page> 
     </form-login-config> 
    </login-config> 
    <security-constraint> 
     <web-resource-collection> 
      <web-resource-name>Secure Resource</web-resource-name> 
      <description/> 
      <url-pattern>/faces/unprotected/*</url-pattern> 
      <http-method>GET</http-method> 
      <http-method>POST</http-method> 
      <http-method>HEAD</http-method> 
      <http-method>PUT</http-method> 
      <http-method>OPTIONS</http-method> 
      <http-method>TRACE</http-method> 
      <http-method>DELETE</http-method>   
     </web-resource-collection> 
     <auth-constraint> 
      <role-name>C</role-name> 
     </auth-constraint>   
    </security-constraint> 
    <security-constraint> 
     <web-resource-collection> 
      <web-resource-name>Secure Resource</web-resource-name> 
      <description /> 
      <url-pattern>/faces/protected/*</url-pattern> 
      <http-method>GET</http-method> 
      <http-method>POST</http-method> 
      <http-method>HEAD</http-method> 
      <http-method>PUT</http-method> 
      <http-method>OPTIONS</http-method> 
      <http-method>TRACE</http-method> 
      <http-method>DELETE</http-method> 
     </web-resource-collection> 
     <auth-constraint> 
      <role-name>C</role-name> 
     </auth-constraint> 
     <user-data-constraint> 
      <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
     </user-data-constraint>  
    </security-constraint> 
    <security-role> 
     <description> Role Client </description> 
     <role-name>C</role-name> 
    </security-role> 

、これが私のserver.xmlです:私は保護されたパスに入力したときに

<Connector port="8080" protocol="HTTP/1.1" 
       maxThreads="400" 
       maxKeepAliveRequests="1" 
       acceptCount="100" 
       connectionTimeout="3000" 
       redirectPort="8443" 
       compression="on" 
       compressionMinSize="2048" 
       noCompressionUserAgents="gozilla, traviata" 
       compressableMimeType="text/javascript,text/css,text/html, text/xml,text/plain,application/x-javascript,application/javascript,application/xhtml+xml" /> 


    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" SSLEnabled="true" 
       maxThreads="400" scheme="https" secure="true" 
       clientAuth="optional" sslProtocol="TLS" 
       SSLCertificateFile="path/to/crt" 
       SSLCertificateKeyFile="path/to/pem"/> 

、それはHTTPSに切り替わります(ポート8443)、私がpath/faces/unprotected/somthingに入ると、HTTPSを使用したままです。

保護されていないパスに入ると、SSL以外の通信に戻ります(そうでなければ、ブラウザに正確なアドレスを設定すると再びログインする必要があります)。

設定に何が問題がありますか?

私はこのようなことをする方法がありますか?

2回目の認証を求めずにページを呼び出すことはできますか?

+0

それを単純に再インストールすると、簡単な解決策になります –

+0

何を再インストールしますか? – mohamida

答えて

1

はい、これはTomcatの通常の動作です。

httpsに移動すると、URLが明示的にhttpでない限り、他のURLをhttpにリダイレクトしません。あなたが本当にに必要

場合は、URLが保護されたパターンの一部でない場合は、その後、チェックバックのhttpにリダイレクトするようFilterを記述する必要があります。

+0

しかし、それはダブルログインの問題を解決するつもりはない! – mohamida

+0

@mohamida:あなたがすでにログインしているかどうかを 'Filter'で確認できます – JoseK

+0

あなたは例がありますか? – mohamida

1

HTTPSでログインしてからHTTPに戻った場合、認証されたクッキーを中間者攻撃に公開しています。これは悪いです。

セッションが認証されている間は、HTTPSのままにしてください。

SSLを実行するために必要な計算は、あなたのアプリケーションが行う作業と比較して、まったく簡単です。ちょうどSSLに固執する。

関連する問題