File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
java/ql/lib/semmle/code/java/security Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,8 @@ predicate trustedDomain(string domainName) {
61
61
*/
62
62
private predicate trustedSocketFactory ( MethodAccess setSocketFactory , boolean default ) {
63
63
exists ( MethodAccess getSocketFactory , MethodAccess initSslContext |
64
- exists ( Method m | setSocketFactory .getMethod ( ) .getASourceOverriddenMethod * ( ) = m |
65
- default = true and
66
- m .getDeclaringType ( ) instanceof HttpsUrlConnection and
67
- m .hasName ( "setDefaultSSLSocketFactory" )
64
+ exists ( Method m | setSocketFactory .getMethod ( ) = m |
65
+ default = true and m instanceof SetDefaultConnectionFactoryMethod
68
66
or
69
67
default = false and m instanceof SetConnectionFactoryMethod
70
68
) and
Original file line number Diff line number Diff line change @@ -150,6 +150,13 @@ class SetConnectionFactoryMethod extends Method {
150
150
}
151
151
}
152
152
153
+ class SetDefaultConnectionFactoryMethod extends Method {
154
+ SetDefaultConnectionFactoryMethod ( ) {
155
+ this .hasName ( "setDefaultSSLSocketFactory" ) and
156
+ this .getDeclaringType ( ) .getAnAncestor ( ) instanceof HttpsUrlConnection
157
+ }
158
+ }
159
+
153
160
class SetHostnameVerifierMethod extends Method {
154
161
SetHostnameVerifierMethod ( ) {
155
162
this .hasName ( "setHostnameVerifier" ) and
You can’t perform that action at this time.
0 commit comments