Newer
Older
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Description: Disables Conscrypt support (missing dependency)
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/handler/pom.xml
+++ b/handler/pom.xml
@@ -96,6 +96,7 @@
<excludes>
<exclude>**/*Alpn*.java</exclude>
<exclude>**/*Npn*.java</exclude>
+ <exclude>**/*Conscrypt*.java</exclude>
</excludes>
</configuration>
</plugin>
--- a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
+++ b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
@@ -243,48 +243,6 @@
return ((ReferenceCountedOpenSslEngine) engine).jdkCompatibilityMode;
}
},
- CONSCRYPT(true, COMPOSITE_CUMULATOR) {
- @Override
- SSLEngineResult unwrap(SslHandler handler, ByteBuf in, int readerIndex, int len, ByteBuf out)
- throws SSLException {
- int nioBufferCount = in.nioBufferCount();
- int writerIndex = out.writerIndex();
- final SSLEngineResult result;
- if (nioBufferCount > 1) {
- /*
- * Use a special unwrap method without additional memory copies.
- */
- try {
- handler.singleBuffer[0] = toByteBuffer(out, writerIndex, out.writableBytes());
- result = ((ConscryptAlpnSslEngine) handler.engine).unwrap(
- in.nioBuffers(readerIndex, len),
- handler.singleBuffer);
- } finally {
- handler.singleBuffer[0] = null;
- }
- } else {
- result = handler.engine.unwrap(toByteBuffer(in, readerIndex, len),
- toByteBuffer(out, writerIndex, out.writableBytes()));
- }
- out.writerIndex(writerIndex + result.bytesProduced());
- return result;
- }
-
- @Override
- int calculateWrapBufferCapacity(SslHandler handler, int pendingBytes, int numComponents) {
- return ((ConscryptAlpnSslEngine) handler.engine).calculateOutNetBufSize(pendingBytes, numComponents);
- }
-
- @Override
- int calculatePendingData(SslHandler handler, int guess) {
- return guess;
- }
-
- @Override
- boolean jdkCompatibilityMode(SSLEngine engine) {
- return true;
- }
- },
JDK(false, MERGE_CUMULATOR) {
@Override
SSLEngineResult unwrap(SslHandler handler, ByteBuf in, int readerIndex, int len, ByteBuf out)
@@ -330,8 +288,7 @@
};
static SslEngineType forEngine(SSLEngine engine) {
- return engine instanceof ReferenceCountedOpenSslEngine ? TCNATIVE :
- engine instanceof ConscryptAlpnSslEngine ? CONSCRYPT : JDK;
+ return engine instanceof ReferenceCountedOpenSslEngine ? TCNATIVE : JDK;
}
SslEngineType(boolean wantsDirectBuffer, Cumulator cumulator) {
--- a/handler/src/main/java/io/netty/handler/ssl/JdkAlpnApplicationProtocolNegotiator.java
+++ b/handler/src/main/java/io/netty/handler/ssl/JdkAlpnApplicationProtocolNegotiator.java
@@ -27,7 +27,7 @@
*/
@Deprecated
public final class JdkAlpnApplicationProtocolNegotiator extends JdkBaseApplicationProtocolNegotiator {
- private static final boolean AVAILABLE = Conscrypt.isAvailable() ||
+ private static final boolean AVAILABLE =
jdkAlpnSupported() ||
JettyAlpnSslEngine.isAvailable();