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 java.net.Socket;
19 import java.security.cert.CertificateException;
20 import java.security.cert.X509Certificate;
21 import javax.net.ssl.SSLEngine;
22 import javax.net.ssl.X509ExtendedTrustManager;
23 import javax.net.ssl.X509TrustManager;
24
25 import static io.netty.util.internal.ObjectUtil.checkNotNull;
26
27 final class X509TrustManagerWrapper extends X509ExtendedTrustManager {
28
29 private final X509TrustManager delegate;
30
31 X509TrustManagerWrapper(X509TrustManager delegate) {
32 this.delegate = checkNotNull(delegate, "delegate");
33 }
34
35 @Override
36 public void checkClientTrusted(X509Certificate[] chain, String s) throws CertificateException {
37 delegate.checkClientTrusted(chain, s);
38 }
39
40 @Override
41 public void checkClientTrusted(X509Certificate[] chain, String s, Socket socket)
42 throws CertificateException {
43 delegate.checkClientTrusted(chain, s);
44 }
45
46 @Override
47 public void checkClientTrusted(X509Certificate[] chain, String s, SSLEngine sslEngine)
48 throws CertificateException {
49 delegate.checkClientTrusted(chain, s);
50 }
51
52 @Override
53 public void checkServerTrusted(X509Certificate[] chain, String s) throws CertificateException {
54 delegate.checkServerTrusted(chain, s);
55 }
56
57 @Override
58 public void checkServerTrusted(X509Certificate[] chain, String s, Socket socket)
59 throws CertificateException {
60 delegate.checkServerTrusted(chain, s);
61 }
62
63 @Override
64 public void checkServerTrusted(X509Certificate[] chain, String s, SSLEngine sslEngine)
65 throws CertificateException {
66 delegate.checkServerTrusted(chain, s);
67 }
68
69 @Override
70 public X509Certificate[] getAcceptedIssuers() {
71 return delegate.getAcceptedIssuers();
72 }
73 }