1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.ssl.util;
17
18 import io.netty.util.internal.SuppressJava6Requirement;
19
20 import javax.net.ssl.SSLEngine;
21 import javax.net.ssl.X509ExtendedTrustManager;
22 import javax.net.ssl.X509TrustManager;
23 import java.net.Socket;
24 import java.security.cert.CertificateException;
25 import java.security.cert.X509Certificate;
26
27 import static io.netty.util.internal.ObjectUtil.*;
28
29 @SuppressJava6Requirement(reason = "Usage guarded by java version check")
30 final class X509TrustManagerWrapper extends X509ExtendedTrustManager {
31
32 private final X509TrustManager delegate;
33
34 X509TrustManagerWrapper(X509TrustManager delegate) {
35 this.delegate = checkNotNull(delegate, "delegate");
36 }
37
38 @Override
39 public void checkClientTrusted(X509Certificate[] chain, String s) throws CertificateException {
40 delegate.checkClientTrusted(chain, s);
41 }
42
43 @Override
44 public void checkClientTrusted(X509Certificate[] chain, String s, Socket socket)
45 throws CertificateException {
46 delegate.checkClientTrusted(chain, s);
47 }
48
49 @Override
50 public void checkClientTrusted(X509Certificate[] chain, String s, SSLEngine sslEngine)
51 throws CertificateException {
52 delegate.checkClientTrusted(chain, s);
53 }
54
55 @Override
56 public void checkServerTrusted(X509Certificate[] chain, String s) throws CertificateException {
57 delegate.checkServerTrusted(chain, s);
58 }
59
60 @Override
61 public void checkServerTrusted(X509Certificate[] chain, String s, Socket socket)
62 throws CertificateException {
63 delegate.checkServerTrusted(chain, s);
64 }
65
66 @Override
67 public void checkServerTrusted(X509Certificate[] chain, String s, SSLEngine sslEngine)
68 throws CertificateException {
69 delegate.checkServerTrusted(chain, s);
70 }
71
72 @Override
73 public X509Certificate[] getAcceptedIssuers() {
74 return delegate.getAcceptedIssuers();
75 }
76 }