You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SECURITY.md
+88-16Lines changed: 88 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,29 +16,101 @@ You may need to [update the security provider](https://developer.android.com/tra
16
16
17
17
## TLS with OpenSSL
18
18
19
-
This is currently the recommended approach for using gRPC over TLS (on non-Android systems).
19
+
This is currently the recommended approach for using gRPC over TLS (on non-Android systems).
20
20
21
-
### Benefits of using OpenSSL
21
+
The main benefits of using OpenSSL are:
22
22
23
23
1.**Speed**: In local testing, we've seen performance improvements of 3x over the JDK. GCM, which is used by the only cipher suite required by the HTTP/2 spec, is 10-500x faster.
24
24
2.**Ciphers**: OpenSSL has its own ciphers and is not dependent on the limitations of the JDK. This allows supporting GCM on Java 7.
25
25
3.**ALPN to NPN Fallback**: if the remote endpoint doesn't support ALPN.
26
26
4.**Version Independence**: does not require using a different library version depending on the JDK update.
27
27
28
-
### Requirements for using OpenSSL
28
+
Support for OpenSSL is only provided for the Netty transport via [netty-tcnative](https://github.com/netty/netty-tcnative), which is a fork of
29
+
[Apache Tomcat's tcnative](http://tomcat.apache.org/native-doc/), a JNI wrapper around OpenSSL.
29
30
30
-
1. Currently only supported by the Netty transport (via netty-tcnative).
31
-
2.[OpenSSL](https://www.openssl.org/) version >= 1.0.2 for ALPN support, or version >= 1.0.1 for NPN.
32
-
3.[netty-tcnative](https://github.com/netty/netty-tcnative) version >= 1.1.33.Fork7 must be on classpath.
33
-
4. Supported platforms (for netty-tcnative): `linux-x86_64`, `mac-x86_64`, `windows-x86_64`. Supporting other platforms will require manually building netty-tcnative.
31
+
### OpenSSL: Dynamic vs Static (which to use?)
34
32
35
-
If the above requirements met, the Netty transport will automatically select OpenSSL as the default TLS provider.
33
+
As of version `1.1.33.Fork13`, netty-tcnative provides two options for usage: statically or dynamically linked. For simplification of initial setup,
34
+
we recommend that users first look at `netty-tcnative-boringssl-static`, which is statically linked against BoringSSL and Apache APR. Using this artifact requires no extra installation and guarantees that ALPN and the ciphers required for
35
+
HTTP/2 are available.
36
36
37
-
### Configuring netty-tcnative
37
+
Production systems, however, may require an easy upgrade path for OpenSSL security patches. In this case, relying on the statically linked artifact also implies waiting for the Netty team
38
+
to release the new artifact to Maven Central, which can take some time. A better solution in this case is to use the dynamically linked `netty-tcnative` artifact, which allows the site administrator
39
+
to easily upgrade OpenSSL in the standard way (e.g. apt-get) without relying on any new builds from Netty.
38
40
39
-
[Netty-tcnative](https://github.com/netty/netty-tcnative) is a fork of [Apache Tomcat's tcnative](http://tomcat.apache.org/native-doc/), a JNI wrapper around OpenSSL.
Netty uses classifiers when deploying to [Maven Central](http://repo1.maven.org/maven2/io/netty/netty-tcnative/) to provide distributions for the various platforms. On Linux it should be noted that OpenSSL uses a different soname for Fedora derivatives than other Linux releases. To work around this limitation, netty-tcnative deploys two separate versions for linux.
43
+
This is the simplest way to configure the Netty transport for OpenSSL. You just need to add the appropriate `netty-tcnative-boringssl-static` artifact to your application's classpath.
44
+
45
+
Artifacts are available on [Maven Central](http://repo1.maven.org/maven2/io/netty/netty-tcnative-boringssl-static/) for the following platforms:
46
+
47
+
Maven Classifier | Description
48
+
---------------- | -----------
49
+
windows-x86_64 | Windows distribution
50
+
osx-x86_64 | Mac distribution
51
+
linux-x86_64 | Linux distribution
52
+
53
+
##### Getting netty-tcnative-boringssl-static from Maven
54
+
55
+
In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-plugin) to help simplify the dependency.
If for any reason you need to dynamically link against OpenSSL (e.g. you need control over the version of OpenSSL), you can instead use the `netty-tcnative` artifact.
106
+
107
+
Requirements:
108
+
109
+
1.[OpenSSL](https://www.openssl.org/) version >= 1.0.2 for ALPN support, or version >= 1.0.1 for NPN.
110
+
2.[Apache APR library (libapr-1)](https://apr.apache.org/) version >= 1.5.2.
111
+
3.[netty-tcnative](https://github.com/netty/netty-tcnative) version >= 1.1.33.Fork7 must be on classpath. Prior versions only supported NPN and only Fedora-derivatives were supported for Linux.
112
+
113
+
Artifacts are available on [Maven Central](http://repo1.maven.org/maven2/io/netty/netty-tcnative/) for the following platforms:
42
114
43
115
Classifier | Description
44
116
---------------- | -----------
@@ -47,9 +119,9 @@ osx-x86_64 | Mac distribution
47
119
linux-x86_64 | Used for non-Fedora derivatives of Linux
48
120
linux-x86_64-fedora | Used for Fedora derivatives
49
121
50
-
*NOTE: Make sure you use a version of netty-tcnative >= 1.1.33.Fork7. Prior versions only supported NPN and only Fedora-derivatives were supported for Linux.*
122
+
On Linux it should be noted that OpenSSL uses a different soname for Fedora derivatives than other Linux releases. To work around this limitation, netty-tcnative deploys two separate versions for linux.
51
123
52
-
#### Getting netty-tcnative from Maven
124
+
#####Getting netty-tcnative from Maven
53
125
54
126
In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-plugin) to help simplify the dependency.
55
127
@@ -59,7 +131,7 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
59
131
<dependency>
60
132
<groupId>io.netty</groupId>
61
133
<artifactId>netty-tcnative</artifactId>
62
-
<version>1.1.33.Fork11</version>
134
+
<version>1.1.33.Fork13</version>
63
135
<classifier>${tcnative.classifier}</classifier>
64
136
</dependency>
65
137
</dependencies>
@@ -102,7 +174,7 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
102
174
</project>
103
175
```
104
176
105
-
#### Getting netty-tcnative from Gradle
177
+
#####Getting netty-tcnative from Gradle
106
178
107
179
Gradle you can use the [osdetector-gradle-plugin](https://github.com/google/osdetector-gradle-plugin), which is a wrapper around the os-maven-plugin.
0 commit comments