1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.ssl;
17
18 import io.netty.buffer.ByteBufAllocator;
19
20 import java.security.cert.Certificate;
21 import java.util.Map;
22
23 import javax.net.ssl.SSLEngine;
24 import javax.net.ssl.SSLException;
25
26
27
28
29
30 public abstract class OpenSslContext extends ReferenceCountedOpenSslContext {
31 OpenSslContext(Iterable<String> ciphers, CipherSuiteFilter cipherFilter, ApplicationProtocolConfig apnCfg,
32 int mode, Certificate[] keyCertChain,
33 ClientAuth clientAuth, String[] protocols, boolean startTls, String endpointIdentificationAlgorithm,
34 boolean enableOcsp, ResumptionController resumptionController,
35 Map.Entry<SslContextOption<?>, Object>... options)
36 throws SSLException {
37 super(ciphers, cipherFilter, toNegotiator(apnCfg), mode, keyCertChain,
38 clientAuth, protocols, startTls, endpointIdentificationAlgorithm, enableOcsp, false,
39 resumptionController, options);
40 }
41
42 OpenSslContext(Iterable<String> ciphers, CipherSuiteFilter cipherFilter, OpenSslApplicationProtocolNegotiator apn,
43 int mode, Certificate[] keyCertChain,
44 ClientAuth clientAuth, String[] protocols, boolean startTls, boolean enableOcsp,
45 ResumptionController resumptionController,
46 Map.Entry<SslContextOption<?>, Object>... options)
47 throws SSLException {
48 super(ciphers, cipherFilter, apn, mode, keyCertChain,
49 clientAuth, protocols, startTls, null, enableOcsp, false, resumptionController, options);
50 }
51
52 @Override
53 final SSLEngine newEngine0(ByteBufAllocator alloc, String peerHost, int peerPort, boolean jdkCompatibilityMode) {
54 return new OpenSslEngine(this, alloc, peerHost, peerPort, jdkCompatibilityMode,
55 endpointIdentificationAlgorithm);
56 }
57
58 @Override
59 @SuppressWarnings("FinalizeDeclaration")
60 protected final void finalize() throws Throwable {
61 super.finalize();
62 OpenSsl.releaseIfNeeded(this);
63 }
64 }