File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
core/src/main/java/io/undertow/predicate Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 19
19
package io .undertow .predicate ;
20
20
21
21
import io .undertow .server .HttpServerExchange ;
22
+ import io .undertow .server .SSLSessionInfo ;
22
23
23
24
import java .util .Collections ;
24
25
import java .util .Map ;
25
26
import java .util .Set ;
26
27
28
+ import javax .net .ssl .SSLSession ;
29
+
27
30
/**
28
31
* @author Stuart Douglas
29
32
*/
@@ -33,7 +36,10 @@ public class SecurePredicate implements Predicate {
33
36
34
37
@ Override
35
38
public boolean resolve (HttpServerExchange value ) {
36
- return value .getRequestScheme ().equals ("https" );
39
+ final SSLSession session = value .getConnection ().getSslSession ();
40
+ final SSLSessionInfo info = value .getConnection ().getSslSessionInfo ();
41
+ return (session != null && session .isValid ())
42
+ || (info != null && info .getSSLSession () != null && info .getSSLSession ().isValid ());
37
43
}
38
44
39
45
public String toString () {
You can’t perform that action at this time.
0 commit comments