Browse Source

Added SSL support to the tutorial app Jetty plugin configuration and added a requirement for SSL on the "extremely secure" page.

Luke Taylor 17 năm trước cách đây
mục cha
commit
b85f76e6c1

BIN
samples/tutorial/keystore


+ 12 - 0
samples/tutorial/pom.xml

@@ -96,6 +96,18 @@
                 <version>6.1.5</version>
                 <configuration>
                     <contextPath>/tutorial</contextPath>
+                    <connectors>
+                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                            <port>8080</port>
+                            <confidentialPort>8443</confidentialPort>
+                        </connector>
+                        <connector implementation="org.mortbay.jetty.security.SslSocketConnector">
+                            <port>8443</port>
+                            <keystore>keystore</keystore>
+                            <password>password</password>
+                            <keyPassword>password</keyPassword>
+                        </connector>
+                    </connectors>
                 </configuration>
             </plugin>
         </plugins>

+ 6 - 0
samples/tutorial/readme.txt

@@ -0,0 +1,6 @@
+Run the application directly from the checked out source tree, using the command
+
+mvn jetty:run
+
+This will start jetty on port 8080, with SSL support on port 8443.
+

+ 1 - 1
samples/tutorial/src/main/webapp/WEB-INF/applicationContext-security-ns.xml

@@ -15,7 +15,7 @@
 	<annotation-driven/>
 
     <http>
-        <intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR"/>
+        <intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR" requires-channel="https"/>
         <intercept-url pattern="/secure/**" access="IS_AUTHENTICATED_REMEMBERED" />
 		<!-- Disable web URI authorization, as we're using <annotation-driven> and have @Secured the services layer instead
         <intercept-url pattern="/listAccounts.html" access="IS_AUTHENTICATED_REMEMBERED" />