Skip to content

Commit 0a9124c

Browse files
committed
in-progress changes.
1 parent 23a0822 commit 0a9124c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/main/java/io/grpc/internal/CertificateUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public class CertificateUtils {
3737
/**
3838
* Creates X509TrustManagers using the provided CA certs.
3939
*/
40-
public static TrustManager[] createTrustManager(byte[] rootCerts) throws GeneralSecurityException {
40+
public static TrustManager[] createTrustManager(byte[] rootCerts)
41+
throws GeneralSecurityException {
4142
InputStream rootCertsStream = new ByteArrayInputStream(rootCerts);
4243
try {
4344
return io.grpc.internal.CertificateUtils.createTrustManager(rootCertsStream);

okhttp/src/main/java/io/grpc/okhttp/OkHttpServerBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package io.grpc.okhttp;
1818

1919
import static com.google.common.base.Preconditions.checkArgument;
20+
import static io.grpc.internal.CertificateUtils.createTrustManager;
2021

2122
import com.google.common.base.Preconditions;
2223
import com.google.errorprone.annotations.CanIgnoreReturnValue;
@@ -425,7 +426,7 @@ static HandshakerSocketFactoryResult handshakerSocketFactoryFrom(ServerCredentia
425426
tm = tlsCreds.getTrustManagers().toArray(new TrustManager[0]);
426427
} else if (tlsCreds.getRootCertificates() != null) {
427428
try {
428-
tm = OkHttpChannelBuilder.createTrustManager(tlsCreds.getRootCertificates());
429+
tm = createTrustManager(tlsCreds.getRootCertificates());
429430
} catch (GeneralSecurityException gse) {
430431
log.log(Level.FINE, "Exception loading root certificates from credential", gse);
431432
return HandshakerSocketFactoryResult.error(

0 commit comments

Comments
 (0)