Skip to content

Commit 02a1041

Browse files
committed
Revert "Merge remote-tracking branch 'origin/authorityverifyokhttp' into authoritychecktls"
This reverts commit 8576a4e, reversing changes made to da19b28.
1 parent 0627bf4 commit 02a1041

File tree

6 files changed

+102
-857
lines changed

6 files changed

+102
-857
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.grpc.internal;
1818

19-
import java.io.ByteArrayInputStream;
2019
import java.io.IOException;
2120
import java.io.InputStream;
2221
import java.security.GeneralSecurityException;
@@ -37,21 +36,8 @@ public class CertificateUtils {
3736
/**
3837
* Creates X509TrustManagers using the provided CA certs.
3938
*/
40-
public static TrustManager[] createTrustManager(byte[] rootCerts)
41-
throws GeneralSecurityException {
42-
InputStream rootCertsStream = new ByteArrayInputStream(rootCerts);
43-
try {
44-
return io.grpc.internal.CertificateUtils.createTrustManager(rootCertsStream);
45-
} finally {
46-
GrpcUtil.closeQuietly(rootCertsStream);
47-
}
48-
}
49-
50-
/**
51-
* Creates X509TrustManagers using the provided input stream of CA certs.
52-
*/
5339
public static TrustManager[] createTrustManager(InputStream rootCerts)
54-
throws GeneralSecurityException {
40+
throws GeneralSecurityException {
5541
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
5642
try {
5743
ks.load(null, null);
@@ -66,13 +52,13 @@ public static TrustManager[] createTrustManager(InputStream rootCerts)
6652
}
6753

6854
TrustManagerFactory trustManagerFactory =
69-
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
55+
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
7056
trustManagerFactory.init(ks);
7157
return trustManagerFactory.getTrustManagers();
7258
}
7359

7460
private static X509Certificate[] getX509Certificates(InputStream inputStream)
75-
throws CertificateException {
61+
throws CertificateException {
7662
CertificateFactory factory = CertificateFactory.getInstance("X.509");
7763
Collection<? extends Certificate> certs = factory.generateCertificates(inputStream);
7864
return certs.toArray(new X509Certificate[0]);

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

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)