1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
package net.sourceforge.subsonic.androidapp.service.ssl; |
28 |
|
|
29 |
|
import java.security.cert.CertificateException; |
30 |
|
import java.security.cert.X509Certificate; |
31 |
|
|
32 |
|
import javax.net.ssl.X509TrustManager; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@since |
37 |
|
|
|
|
| 30,8% |
Uncovered Elements: 9 (13) |
Complexity: 5 |
Complexity Density: 0,71 |
|
38 |
|
class TrustManagerDecorator implements X509TrustManager { |
39 |
|
|
40 |
|
private final X509TrustManager trustManager; |
41 |
|
private final TrustStrategy trustStrategy; |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
43 |
2
|
TrustManagerDecorator(final X509TrustManager trustManager, final TrustStrategy trustStrategy) {... |
44 |
2
|
super(); |
45 |
2
|
this.trustManager = trustManager; |
46 |
2
|
this.trustStrategy = trustStrategy; |
47 |
|
} |
48 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
0
|
public void checkClientTrusted(... |
50 |
|
final X509Certificate[] chain, final String authType) throws CertificateException { |
51 |
0
|
this.trustManager.checkClientTrusted(chain, authType); |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
54 |
0
|
public void checkServerTrusted(... |
55 |
|
final X509Certificate[] chain, final String authType) throws CertificateException { |
56 |
0
|
if (!this.trustStrategy.isTrusted(chain, authType)) { |
57 |
0
|
this.trustManager.checkServerTrusted(chain, authType); |
58 |
|
} |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
0
|
public X509Certificate[] getAcceptedIssuers() {... |
62 |
0
|
return this.trustManager.getAcceptedIssuers(); |
63 |
|
} |
64 |
|
|
65 |
|
} |